org.jacoco.core.data
Class CompactDataInput

java.lang.Object
  extended by java.io.InputStream
      extended by java.io.FilterInputStream
          extended by java.io.DataInputStream
              extended by org.jacoco.core.data.CompactDataInput
All Implemented Interfaces:
Closeable, DataInput

public class CompactDataInput
extends DataInputStream

Additional data input methods for compact storage of data structures.

Version:
$Revision: $
Author:
Marc R. Hoffmann
See Also:
CompactDataOutput

Field Summary
 
Fields inherited from class java.io.FilterInputStream
in
 
Constructor Summary
CompactDataInput(InputStream in)
          Creates a new CompactDataInput that uses the specified underlying input stream.
 
Method Summary
 void finishPackedBoolean()
          Finalizes the input of a sequence of packed boolean values.
 boolean readPackedBoolean()
          Reads a boolean value.
 int readVarInt()
          Reads a variable length representation of an integer value.
 
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

CompactDataInput

public CompactDataInput(InputStream in)
Creates a new CompactDataInput that uses the specified underlying input stream.

Parameters:
in - underlying input stream
Method Detail

readVarInt

public int readVarInt()
               throws IOException
Reads a variable length representation of an integer value.

Returns:
read value
Throws:
IOException - might be thrown by the underlying stream

readPackedBoolean

public boolean readPackedBoolean()
                          throws IOException
Reads a boolean value. Internally a sequence of boolean values is packed into single bits. After the last boolean value has been read finishPackedBoolean() has to be called.

Returns:
boolean value
Throws:
IOException

finishPackedBoolean

public void finishPackedBoolean()
                         throws IOException
Finalizes the input of a sequence of packed boolean values.

Throws:
IOException