Class PackedDataInputStream

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

    class PackedDataInputStream
    extends java.io.DataInputStream
    An input stream that reads integers that were packed by PackedDataOutputStream

    Thread-Safety

    This class is not thread-safe can not be shared between threads.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) static int MAX_1BYTE  
      • Fields inherited from class java.io.FilterInputStream

        in
    • Constructor Summary

      Constructors 
      Constructor Description
      PackedDataInputStream​(java.io.InputStream in)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int readPackedU32()
      Reads a packed unsigned integer.
      • Methods inherited from class java.io.DataInputStream

        read, read, readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF, readUTF, skipBytes
      • Methods inherited from class java.io.FilterInputStream

        available, close, mark, markSupported, read, reset, skip
      • Methods inherited from class java.lang.Object

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

      • PackedDataInputStream

        public PackedDataInputStream​(java.io.InputStream in)
    • Method Detail

      • readPackedU32

        public int readPackedU32()
                          throws java.io.IOException
        Reads a packed unsigned integer. Every byte uses the first bit as a control bit to signal when there are additional bytes to be read. The remaining seven bits are data. Depending on the size of the number one to five bytes may be read.
        Returns:
        the unpacked integer
        Throws:
        java.io.IOException