Class BitPaddingStream

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable

    final class BitPaddingStream
    extends java.io.FilterInputStream
    BitPaddingStream.
    Version:
    $Id: Foo.java,v 1.0 15/11/2016 harald.kuhr Exp$
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private int bitsPerSample  
      private java.nio.ByteBuffer buffer  
      private int componentSize  
      private byte[] inputBuffer  
      private static int[] MASK  
      • Fields inherited from class java.io.FilterInputStream

        in
    • Constructor Summary

      Constructors 
      Constructor Description
      BitPaddingStream​(java.io.InputStream stream, int samplesPerPixel, int bitsPerSample, int colsInTile, java.nio.ByteOrder byteOrder)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private boolean fillBuffer()  
      private void padBits​(java.nio.ByteBuffer buffer, int componentSize, int bitsPerSample, byte[] samples)  
      int read()  
      int read​(byte[] b, int off, int len)  
      private boolean readFully​(byte[] bytes)  
      long skip​(long n)  
      • Methods inherited from class java.io.FilterInputStream

        available, close, mark, markSupported, read, reset
      • Methods inherited from class java.io.InputStream

        nullInputStream, readAllBytes, readNBytes, readNBytes, transferTo
      • Methods inherited from class java.lang.Object

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

      • MASK

        private static final int[] MASK
      • bitsPerSample

        private final int bitsPerSample
      • inputBuffer

        private final byte[] inputBuffer
      • buffer

        private final java.nio.ByteBuffer buffer
      • componentSize

        private final int componentSize
    • Constructor Detail

      • BitPaddingStream

        BitPaddingStream​(java.io.InputStream stream,
                         int samplesPerPixel,
                         int bitsPerSample,
                         int colsInTile,
                         java.nio.ByteOrder byteOrder)
    • Method Detail

      • read

        public int read()
                 throws java.io.IOException
        Overrides:
        read in class java.io.FilterInputStream
        Throws:
        java.io.IOException
      • readFully

        private boolean readFully​(byte[] bytes)
                           throws java.io.IOException
        Throws:
        java.io.IOException
      • read

        public int read​(byte[] b,
                        int off,
                        int len)
                 throws java.io.IOException
        Overrides:
        read in class java.io.FilterInputStream
        Throws:
        java.io.IOException
      • skip

        public long skip​(long n)
                  throws java.io.IOException
        Overrides:
        skip in class java.io.FilterInputStream
        Throws:
        java.io.IOException
      • fillBuffer

        private boolean fillBuffer()
                            throws java.io.IOException
        Throws:
        java.io.IOException
      • padBits

        private void padBits​(java.nio.ByteBuffer buffer,
                             int componentSize,
                             int bitsPerSample,
                             byte[] samples)