Class NettyBufferFactory
java.lang.Object
org.apache.tinkerpop.gremlin.util.ser.NettyBufferFactory
- All Implemented Interfaces:
BufferFactory<io.netty.buffer.ByteBuf>
Represents a factory to create
Buffer instances from wrapped ByteBuf instances.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreate(io.netty.buffer.ByteBuf value) Creates a newBuffergiven aBufferFactoryinstance.static voidUtility method to allow reading from the underlying bytes using a NettyByteBufinstance for interoperability, advancing the reader index of theBufferafter the consumer is called.wrap(ByteBuffer value) Wraps a NIO buffer.static voidAllows writing from the underlying bytes using a NettyByteBufinstance for interoperability, advancing the writer index of theBufferafter the consumer is called.
-
Constructor Details
-
NettyBufferFactory
public NettyBufferFactory()
-
-
Method Details
-
create
Description copied from interface:BufferFactoryCreates a newBuffergiven aBufferFactoryinstance.- Specified by:
createin interfaceBufferFactory<io.netty.buffer.ByteBuf>- Returns:
-
wrap
Description copied from interface:BufferFactoryWraps a NIO buffer.- Specified by:
wrapin interfaceBufferFactory<io.netty.buffer.ByteBuf>
-
readRaw
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. -
writeRaw
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.
-