korat.utils.io
Interface IBitWriter

All Known Implementing Classes:
BitOutputStream

public interface IBitWriter

Interface for writing bits (e.g. to OutputStream, RandomFileAccess, etc.)

Author:
Aleksandar Milicevic

Method Summary
 void flush()
          Flush internal buffers to underlying layer
 void writeBits(long b, int len)
          Writes len bits of the given value b starting from bit offset 0.
 void writeBits(long b, int off, int len)
          Writes len bits of the given value b starting from bit offset off.
 void writeDouble(double x)
          Write given double in 64 bits
 void writeFloat(float x)
          Write given float in 32 bits
 void writeInt(int x)
          Write given int in 32 bits
 void writeLong(long x)
          Write given long in 64 bits
 

Method Detail

writeBits

void writeBits(long b,
               int len)
               throws IOException
Writes len bits of the given value b starting from bit offset 0.

Parameters:
b - bits to write
len - number of bits from value b to write
Throws:
IOException - if an I/O error occurs.

writeBits

void writeBits(long b,
               int off,
               int len)
               throws IOException
Writes len bits of the given value b starting from bit offset off.

Parameters:
b - bits to write
off - number of bits from the given value b to skip
len - number of bits from the given value b to write starting from off-th bit
Throws:
IOException - if an I/O error occurs.

writeInt

void writeInt(int x)
              throws IOException
Write given int in 32 bits

Parameters:
x - int value to write
Throws:
IOException - if an I/O error occurs.

writeLong

void writeLong(long x)
               throws IOException
Write given long in 64 bits

Parameters:
x - long value to write
Throws:
IOException - if an I/O error occurs.

writeFloat

void writeFloat(float x)
                throws IOException
Write given float in 32 bits

Parameters:
x - float value to write
Throws:
IOException - if an I/O error occurs.

writeDouble

void writeDouble(double x)
                 throws IOException
Write given double in 64 bits

Parameters:
x - double value to write
Throws:
IOException - if an I/O error occurs.

flush

void flush()
           throws IOException
Flush internal buffers to underlying layer

Throws:
IOException - if an I/O error occurs.