Class ReadableChunkingChannel

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, java.nio.channels.Channel, java.nio.channels.ReadableByteChannel

    @Deprecated
    public class ReadableChunkingChannel
    extends WrapperChannel<java.nio.channels.ReadableByteChannel>
    implements java.nio.channels.ReadableByteChannel
    Deprecated.
    Will be removed to favor lower-level network extensions allowing more control at the Restlet API level.
    Readable byte channel capable of encoding chunked entities.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private int chunkSizeLength
      Deprecated.
      The constant chunk part containing the size of the chunk data.
      private boolean lastChunkWritten
      Deprecated.
      Indicates if the last chunk has already been written.
    • Constructor Summary

      Constructors 
      Constructor Description
      ReadableChunkingChannel​(java.nio.channels.ReadableByteChannel source, int maxBufferSize)
      Deprecated.
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      private int fillChunkSizeString​(int chunkDataSize, java.nio.ByteBuffer targetBuffer)
      Deprecated.
      Returns an hexadecimal chunk size string with a constant length, adding the necessary number of leading zeroes.
      int read​(java.nio.ByteBuffer dst)
      Deprecated.
      Reads some bytes and put them into the destination buffer.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.nio.channels.Channel

        close, isOpen
    • Field Detail

      • chunkSizeLength

        private final int chunkSizeLength
        Deprecated.
        The constant chunk part containing the size of the chunk data.
      • lastChunkWritten

        private boolean lastChunkWritten
        Deprecated.
        Indicates if the last chunk has already been written.
    • Constructor Detail

      • ReadableChunkingChannel

        public ReadableChunkingChannel​(java.nio.channels.ReadableByteChannel source,
                                       int maxBufferSize)
        Deprecated.
        Constructor.
        Parameters:
        source - The source channel.
        maxBufferSize - The total available size that can be read from the source channel.
    • Method Detail

      • fillChunkSizeString

        private int fillChunkSizeString​(int chunkDataSize,
                                        java.nio.ByteBuffer targetBuffer)
        Deprecated.
        Returns an hexadecimal chunk size string with a constant length, adding the necessary number of leading zeroes.
        Parameters:
        chunkDataSize - The chunk data size value.
        targetBuffer - The destination buffer.
        Returns:
        The length of the chunk size string.
      • read

        public int read​(java.nio.ByteBuffer dst)
                 throws java.io.IOException
        Deprecated.
        Reads some bytes and put them into the destination buffer. The bytes come from the underlying channel.
        Specified by:
        read in interface java.nio.channels.ReadableByteChannel
        Parameters:
        dst - The destination buffer.
        Returns:
        The number of bytes read, or -1 if the end of the channel has been reached.
        Throws:
        java.io.IOException