Class NettyBufferFactory
- java.lang.Object
- 
- org.apache.tinkerpop.gremlin.driver.ser.NettyBufferFactory
 
- 
- All Implemented Interfaces:
- BufferFactory<io.netty.buffer.ByteBuf>
 
 public class NettyBufferFactory extends Object implements BufferFactory<io.netty.buffer.ByteBuf> Represents a factory to createBufferinstances from wrappedByteBufinstances.
- 
- 
Constructor SummaryConstructors Constructor Description NettyBufferFactory()
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Buffercreate(io.netty.buffer.ByteBuf value)Creates a newBuffergiven aBufferFactoryinstance.static voidreadRaw(Buffer buffer, Consumer<io.netty.buffer.ByteBuf> consumer)Utility method to allow reading from the underlying bytes using a NettyByteBufinstance for interoperability, advancing the reader index of theBufferafter the consumer is called.Bufferwrap(ByteBuffer value)Wraps a NIO buffer.static voidwriteRaw(Buffer buffer, Consumer<io.netty.buffer.ByteBuf> consumer)Allows writing from the underlying bytes using a NettyByteBufinstance for interoperability, advancing the writer index of theBufferafter the consumer is called.
 
- 
- 
- 
Method Detail- 
createpublic Buffer create(io.netty.buffer.ByteBuf value) Description copied from interface:BufferFactoryCreates a newBuffergiven aBufferFactoryinstance.- Specified by:
- createin interface- BufferFactory<io.netty.buffer.ByteBuf>
- Returns:
 
 - 
wrappublic Buffer wrap(ByteBuffer value) Description copied from interface:BufferFactoryWraps a NIO buffer.- Specified by:
- wrapin interface- BufferFactory<io.netty.buffer.ByteBuf>
 
 - 
readRawpublic static void readRaw(Buffer buffer, Consumer<io.netty.buffer.ByteBuf> consumer) Utility method to allow reading from the underlying bytes using a NettyByteBufinstance for interoperability, advancing the reader index of theBufferafter the consumer is called. Note that theByteBufused by the consumer should not be released by the caller. In case the providedBufferinstance is not aNettyBuffer, it will create aByteBufwrapper for the consumer to use, releasing it after use.
 - 
writeRawpublic static void writeRaw(Buffer buffer, Consumer<io.netty.buffer.ByteBuf> consumer) Allows writing from the underlying bytes using a NettyByteBufinstance for interoperability, advancing the writer index of theBufferafter the consumer is called. Note that theByteBufused by the consumer should not be released by the caller. In case the providedBufferinstance is not aNettyBuffer, it will create aByteBufwrapper for the consumer to use, releasing it after use.
 
- 
 
-