Class ByteReadingListener

    • Constructor Detail

      • ByteReadingListener

        public ByteReadingListener​(Representation source)
                            throws java.io.IOException
        Default constructor. Uses a byte buffer of IoUtils.BUFFER_SIZE length.
        Parameters:
        source - The source representation.
        Throws:
        java.io.IOException
      • ByteReadingListener

        public ByteReadingListener​(Representation source,
                                   int bufferSize)
                            throws java.io.IOException
        Constructor. Uses a byte buffer of a given size.
        Parameters:
        source - The source byte channel.
        bufferSize - The byte buffer to use.
        Throws:
        java.io.IOException
    • Method Detail

      • onContent

        protected final void onContent​(java.nio.ByteBuffer byteBuffer)
        Callback invoked when new content is available.
        Specified by:
        onContent in class ReadingListener
        Parameters:
        byteBuffer - The byte buffer filled with the new content (correctly flip).
      • onContent

        protected abstract void onContent​(java.io.InputStream inputStream)
        Callback invoked when new content is available.
        Parameters:
        inputStream - The input stream allowing to retrieve the new content.