Class FileRegionBuffer

    • 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[]
      int length()
      Number of bytes of the data.
      io.netty.buffer.ByteBuf nettyByteBuf()
      Convert the buffer into an ByteBuf object, used to write the data out.
      java.nio.ByteBuffer nioByteBuffer()
      Exposes this buffer's data as an NIO ByteBuffer.
      java.lang.String path()  
      int referenceCount()
      Returns the reference count.
      NetworkBuffer release()
      If applicable, decrease the reference count by one and deallocates the buffer if the reference count reaches zero.
      NetworkBuffer retain()
      Increase the reference count by one if applicable.
      io.netty.channel.ChannelFuture transformFromChannel​(io.netty.channel.socket.SocketChannel channel, java.lang.String targetPath)
      Use zero-copy transform from socket channel to file
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • FileRegionBuffer

        public FileRegionBuffer​(int length)
    • 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()
      • release

        public NetworkBuffer release()
        Description copied from interface: NetworkBuffer
        If applicable, decrease the reference count by one and deallocates the buffer if the reference count reaches zero.
        Specified by:
        release in interface NetworkBuffer
      • nioByteBuffer

        public java.nio.ByteBuffer nioByteBuffer()
        Description copied from interface: NetworkBuffer
        Exposes 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:
        nioByteBuffer in interface NetworkBuffer
      • nettyByteBuf

        public io.netty.buffer.ByteBuf nettyByteBuf()
        Description copied from interface: NetworkBuffer
        Convert the buffer into an ByteBuf object, used to write the data out.
        Specified by:
        nettyByteBuf in interface NetworkBuffer