Math2mat
|
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) |
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.
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.
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.
s | the String to write. |
RuntimeException | if 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.
x | the char to write. |
r | the number of relevant bits in the char. |
RuntimeException | if r is not between 1 and 16. |
RuntimeException | if 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.
x | the char to write. |
RuntimeException | if 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.
x | the 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.
x | the 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.
x | the 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.
x | the 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.
x | the int to write. |
r | the number of relevant bits in the char. |
RuntimeException | if r is not between 1 and 32. |
RuntimeException | if 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.
x | the 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.
x | the 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.
x | the 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.
s | the String to write. |
r | the number of relevants bits in each character. |
RuntimeException | if r is not between 1 and 16. |
RuntimeException | if any character in the string is not between 0 and 2r - 1. |
Definition at line 276 of file BinaryOut.java.