Math2mat
Public Member Functions

m2m.backend.verifpga.BinaryOut Class Reference

Collaboration diagram for m2m.backend.verifpga.BinaryOut:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 BinaryOut (OutputStream os)
 BinaryOut ()
 BinaryOut (String s)
 BinaryOut (Socket socket)
void flush ()
void close ()
void write (boolean x)
void write (byte x)
void write (int x)
void write (int x, int r)
void write (double x)
void write (long x)
void write (float x)
void write (short x)
void write (char x)
void write (char x, int r)
void write (String s)
void write (String s, int r)

Detailed Description

Binary output. This class provides methods for converting primtive type variables (boolean, byte, char, int, long, float, and double) to sequences of bits and writing them to an output stream. The output stream can be standard output, a file, an OutputStream or a Socket. Uses big-endian (most-significant byte first).

The client must flush() the output stream when finished writing bits.

The client should not intermixing calls to BinaryOut with calls to Out; otherwise unexpected behavior will result.

Definition at line 37 of file BinaryOut.java.


Constructor & Destructor Documentation

m2m.backend.verifpga.BinaryOut.BinaryOut ( OutputStream  os)

Create a binary output stream from an OutputStream.

Definition at line 47 of file BinaryOut.java.

m2m.backend.verifpga.BinaryOut.BinaryOut ( )

Create a binary output stream from standard output.

Definition at line 54 of file BinaryOut.java.

m2m.backend.verifpga.BinaryOut.BinaryOut ( String  s)

Create a binary output stream from a filename.

Definition at line 61 of file BinaryOut.java.

m2m.backend.verifpga.BinaryOut.BinaryOut ( Socket  socket)

Create a binary output stream from a Socket.

Definition at line 72 of file BinaryOut.java.


Member Function Documentation

void m2m.backend.verifpga.BinaryOut.close ( )

Close and flush the binary output stream. Once it is closed, you can no longer write bits.

Definition at line 137 of file BinaryOut.java.

void m2m.backend.verifpga.BinaryOut.flush ( )

Flush the binary output stream, padding 0s if number of bits written so far is not a multiple of 8.

Definition at line 128 of file BinaryOut.java.

void m2m.backend.verifpga.BinaryOut.write ( String  s)

Write the string of 8-bit characters to the binary output stream.

Parameters:
sthe String to write.
Exceptions:
RuntimeExceptionif any character in the string is not between 0 and 255.

Definition at line 262 of file BinaryOut.java.

void m2m.backend.verifpga.BinaryOut.write ( char  x,
int  r 
)

Write the r-bit char to the binary output stream.

Parameters:
xthe char to write.
rthe number of relevant bits in the char.
Exceptions:
RuntimeExceptionif r is not between 1 and 16.
RuntimeExceptionif x is not between 0 and 2r - 1.

Definition at line 246 of file BinaryOut.java.

void m2m.backend.verifpga.BinaryOut.write ( char  x)

Write the 8-bit char to the binary output stream.

Parameters:
xthe char to write.
Exceptions:
RuntimeExceptionif x is not betwen 0 and 255.

Definition at line 234 of file BinaryOut.java.

void m2m.backend.verifpga.BinaryOut.write ( short  x)

Write the 16-bit int to the binary output stream.

Parameters:
xthe short to write.

Definition at line 224 of file BinaryOut.java.

void m2m.backend.verifpga.BinaryOut.write ( float  x)

Write the 32-bit float to the binary output stream.

Parameters:
xthe float to write.

Definition at line 216 of file BinaryOut.java.

void m2m.backend.verifpga.BinaryOut.write ( long  x)

Write the 64-bit long to the binary output stream.

Parameters:
xthe long to write.

Definition at line 201 of file BinaryOut.java.

void m2m.backend.verifpga.BinaryOut.write ( double  x)

Write the 64-bit double to the binary output stream.

Parameters:
xthe double to write.

Definition at line 193 of file BinaryOut.java.

void m2m.backend.verifpga.BinaryOut.write ( int  x,
int  r 
)

Write the r-bit int to the binary output stream.

Parameters:
xthe int to write.
rthe number of relevant bits in the char.
Exceptions:
RuntimeExceptionif r is not between 1 and 32.
RuntimeExceptionif x is not between 0 and 2r - 1.

Definition at line 178 of file BinaryOut.java.

void m2m.backend.verifpga.BinaryOut.write ( int  x)

Write the 32-bit int to the binary output stream.

Parameters:
xthe int to write.

Definition at line 164 of file BinaryOut.java.

void m2m.backend.verifpga.BinaryOut.write ( byte  x)

Write the 8-bit byte to the binary output stream.

Parameters:
xthe byte to write.

Definition at line 156 of file BinaryOut.java.

void m2m.backend.verifpga.BinaryOut.write ( boolean  x)

Write the specified bit to the binary output stream.

Parameters:
xthe boolean to write.

Definition at line 148 of file BinaryOut.java.

void m2m.backend.verifpga.BinaryOut.write ( String  s,
int  r 
)

Write the String of r-bit characters to the binary output stream.

Parameters:
sthe String to write.
rthe number of relevants bits in each character.
Exceptions:
RuntimeExceptionif r is not between 1 and 16.
RuntimeExceptionif any character in the string is not between 0 and 2r - 1.

Definition at line 276 of file BinaryOut.java.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Enumerations