org.jacoco.core.data
Class CompactDataOutput

java.lang.Object
  extended by java.io.OutputStream
      extended by java.io.FilterOutputStream
          extended by java.io.DataOutputStream
              extended by org.jacoco.core.data.CompactDataOutput
All Implemented Interfaces:
Closeable, DataOutput, Flushable

public class CompactDataOutput
extends DataOutputStream

Additional data output methods for compact storage of data structures.

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

Field Summary
 
Fields inherited from class java.io.DataOutputStream
written
 
Fields inherited from class java.io.FilterOutputStream
out
 
Constructor Summary
CompactDataOutput(OutputStream out)
          Creates a new CompactDataOutput instance that writes data to the specified underlying output stream
 
Method Summary
 void finishPackedBoolean()
          Finalizes the output of a sequence of packed boolean values.
 void writePackedBoolean(boolean value)
          Writes a boolean value.
 void writeVarInt(int value)
          Writes a variable length representation of an integer value that reduces the number of written bytes for small positive values.
 
Methods inherited from class java.io.DataOutputStream
flush, size, write, write, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTF
 
Methods inherited from class java.io.FilterOutputStream
close, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.io.DataOutput
write
 

Constructor Detail

CompactDataOutput

public CompactDataOutput(OutputStream out)
Creates a new CompactDataOutput instance that writes data to the specified underlying output stream

Parameters:
out - underlying output stream
Method Detail

writeVarInt

public void writeVarInt(int value)
                 throws IOException
Writes a variable length representation of an integer value that reduces the number of written bytes for small positive values. Depends on the given value 1 to 5 bytes will be written to the underlying stream.

Parameters:
value - value to write
Throws:
IOException

writePackedBoolean

public void writePackedBoolean(boolean value)
                        throws IOException
Writes a boolean value. Internally a sequence of boolean values is packed into single bits. After the last boolean value has been written finishPackedBoolean() has to be called.

Parameters:
value - boolean value
Throws:
IOException

finishPackedBoolean

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

Throws:
IOException