Class RLEDecoder

  • All Implemented Interfaces:
    Decoder

    final class RLEDecoder
    extends java.lang.Object
    implements Decoder
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) static int COMPRESSED_RUN_MASK  
    • Constructor Summary

      Constructors 
      Constructor Description
      RLEDecoder()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int decode​(java.io.InputStream stream, java.nio.ByteBuffer buffer)
      Decodes up to buffer.length bytes from the given input stream, into the given buffer.
      • Methods inherited from class java.lang.Object

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

      • RLEDecoder

        RLEDecoder()
    • Method Detail

      • decode

        public int decode​(java.io.InputStream stream,
                          java.nio.ByteBuffer buffer)
                   throws java.io.IOException
        Description copied from interface: Decoder
        Decodes up to buffer.length bytes from the given input stream, into the given buffer.
        Specified by:
        decode in interface Decoder
        Parameters:
        stream - the input stream to decode data from
        buffer - buffer to store the read data
        Returns:
        the total number of bytes read into the buffer, or 0 if there is no more data because the end of the stream has been reached.
        Throws:
        DecodeException - if encoded data is corrupt.
        java.io.IOException - if an I/O error occurs.
        java.io.EOFException - if a premature end-of-file is encountered.