Class FileRegionBuffer
- java.lang.Object
-
- org.apache.hugegraph.computer.core.network.buffer.FileRegionBuffer
-
- All Implemented Interfaces:
NetworkBuffer
public class FileRegionBuffer extends java.lang.Object implements NetworkBuffer
-
-
Constructor Summary
Constructors Constructor Description FileRegionBuffer(int length)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]copyToByteArray()Copy to a new byte[]intlength()Number of bytes of the data.io.netty.buffer.ByteBufnettyByteBuf()Convert the buffer into an ByteBuf object, used to write the data out.java.nio.ByteBuffernioByteBuffer()Exposes this buffer's data as an NIO ByteBuffer.java.lang.Stringpath()intreferenceCount()Returns the reference count.NetworkBufferrelease()If applicable, decrease the reference count by one and deallocates the buffer if the reference count reaches zero.NetworkBufferretain()Increase the reference count by one if applicable.io.netty.channel.ChannelFuturetransformFromChannel(io.netty.channel.socket.SocketChannel channel, java.lang.String targetPath)Use zero-copy transform from socket channel to file
-
-
-
Method Detail
-
transformFromChannel
public io.netty.channel.ChannelFuture transformFromChannel(io.netty.channel.socket.SocketChannel channel, java.lang.String targetPath)Use zero-copy transform from socket channel to file- Parameters:
channel-targetPath-- Returns:
- channelFuture
-
path
public java.lang.String path()
-
length
public int length()
Description copied from interface:NetworkBufferNumber of bytes of the data.- Specified by:
lengthin interfaceNetworkBuffer
-
retain
public NetworkBuffer retain()
Description copied from interface:NetworkBufferIncrease the reference count by one if applicable.- Specified by:
retainin interfaceNetworkBuffer
-
release
public NetworkBuffer release()
Description copied from interface:NetworkBufferIf applicable, decrease the reference count by one and deallocates the buffer if the reference count reaches zero.- Specified by:
releasein interfaceNetworkBuffer
-
referenceCount
public int referenceCount()
Description copied from interface:NetworkBufferReturns the reference count.- Specified by:
referenceCountin interfaceNetworkBuffer
-
nioByteBuffer
public java.nio.ByteBuffer nioByteBuffer()
Description copied from interface:NetworkBufferExposes this buffer's data as an NIO ByteBuffer. Changing the position and limit of the returned ByteBuffer should not affect the content of this buffer.- Specified by:
nioByteBufferin interfaceNetworkBuffer
-
nettyByteBuf
public io.netty.buffer.ByteBuf nettyByteBuf()
Description copied from interface:NetworkBufferConvert the buffer into an ByteBuf object, used to write the data out.- Specified by:
nettyByteBufin interfaceNetworkBuffer
-
copyToByteArray
public byte[] copyToByteArray()
Description copied from interface:NetworkBufferCopy to a new byte[]- Specified by:
copyToByteArrayin interfaceNetworkBuffer
-
-