Class RLEEncoder

  • All Implemented Interfaces:
    Encoder

    final class RLEEncoder
    extends java.lang.Object
    implements Encoder
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private int pixelSize  
    • Constructor Summary

      Constructors 
      Constructor Description
      RLEEncoder​(int pixelDepth)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private void encode​(java.io.OutputStream stream, byte[] buffer, int pOffset, int length)  
      void encode​(java.io.OutputStream stream, java.nio.ByteBuffer buffer)
      Encodes up to buffer.remaining() bytes into the given input stream, from the given buffer.
      private boolean equalPixel​(byte[] buffer, int offset, int compareOffset)  
      • Methods inherited from class java.lang.Object

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

      • pixelSize

        private final int pixelSize
    • Constructor Detail

      • RLEEncoder

        RLEEncoder​(int pixelDepth)
    • Method Detail

      • encode

        public void encode​(java.io.OutputStream stream,
                           java.nio.ByteBuffer buffer)
                    throws java.io.IOException
        Description copied from interface: Encoder
        Encodes up to buffer.remaining() bytes into the given input stream, from the given buffer.
        Specified by:
        encode in interface Encoder
        Parameters:
        stream - the output stream to encode data to
        buffer - buffer to read data from
        Throws:
        java.io.IOException - if an I/O error occurs
      • encode

        private void encode​(java.io.OutputStream stream,
                            byte[] buffer,
                            int pOffset,
                            int length)
                     throws java.io.IOException
        Throws:
        java.io.IOException
      • equalPixel

        private boolean equalPixel​(byte[] buffer,
                                   int offset,
                                   int compareOffset)