|
Joshua
open source statistical hierarchical phrase-based machine translation system
|
Classes | |
| enum | utf8CharRange |
Public Member Functions | |
| BinaryOut (File file) throws FileNotFoundException, IOException | |
| BinaryOut (String filename) throws FileNotFoundException, IOException | |
| BinaryOut (OutputStream out, boolean writeObjects) throws IOException | |
| void | close () throws IOException |
| void | flush () throws IOException |
| void | write (int b) throws IOException |
| void | write (byte[] b) throws IOException |
| void | write (byte[] b, int off, int len) throws IOException |
| void | writeObject (Object obj) throws IOException |
| void | writeBoolean (boolean v) throws IOException |
| void | writeByte (int v) throws IOException |
| void | writeBytes (String s) throws IOException |
| void | writeChar (int v) throws IOException |
| void | writeChars (String s) throws IOException |
| void | writeDouble (double v) throws IOException |
| void | writeFloat (float v) throws IOException |
| void | writeInt (int v) throws IOException |
| void | writeLong (long v) throws IOException |
| void | writeShort (int v) throws IOException |
| void | writeUTF (String str) throws IOException |
Public Attributes | |
| final int | BITS_PER_BYTE = 8 |
| final int | BOOLEAN_SIZE = 1 |
| final int | BYTE_SIZE = 1 |
| final int | CHAR_SIZE = 2 |
| final int | SHORT_SIZE = 2 |
| final int | FLOAT_SIZE = 4 |
| final int | INT_SIZE = 4 |
| final int | DOUBLE_SIZE = 8 |
| final int | LONG_SIZE = 8 |
Protected Member Functions | |
| void | prepareBuffer (int size) throws IOException |
| void | writeBuffer () throws IOException |
Private Member Functions | |
| long | utfBytesRequired (String str) |
| void | writeUTF (String str, long bytesRequired, boolean forceLongHeader) throws IOException |
Private Attributes | |
| final OutputStream | out |
| int | bufferPosition |
| final byte[] | buffer |
| final char[] | charBuffer |
| final utf8CharRange[] | charSizeBuffer |
| final boolean | writeObjects |
Static Private Attributes | |
| static final Logger | logger = Logger.getLogger(BinaryOut.class.getName()) |
| static final int | BUFFER_SIZE = 1024 |
A BinaryOut writes data to an output stream in raw binary form. Each data type is converted to byte representation.
Unlike ObjectOutputStream, no extra Java meta-data is written to the stream.
| joshua.util.io.BinaryOut.BinaryOut | ( | File | file | ) | throws FileNotFoundException, IOException |
| joshua.util.io.BinaryOut.BinaryOut | ( | String | filename | ) | throws FileNotFoundException, IOException |
| joshua.util.io.BinaryOut.BinaryOut | ( | OutputStream | out, |
| boolean | writeObjects | ||
| ) | throws IOException |
| void joshua.util.io.BinaryOut.close | ( | ) | throws IOException |
| void joshua.util.io.BinaryOut.flush | ( | ) | throws IOException |
| void joshua.util.io.BinaryOut.prepareBuffer | ( | int | size | ) | throws IOException [protected] |
Ensures that the buffer has at least enough space available to hold size additional bytes.
If necessary, the current contents of the buffer will be written to the underlying output stream.
| size |
| IOException |
| long joshua.util.io.BinaryOut.utfBytesRequired | ( | String | str | ) | [private] |
| void joshua.util.io.BinaryOut.write | ( | int | b | ) | throws IOException |
| void joshua.util.io.BinaryOut.write | ( | byte[] | b | ) | throws IOException |
| void joshua.util.io.BinaryOut.write | ( | byte[] | b, |
| int | off, | ||
| int | len | ||
| ) | throws IOException |
| void joshua.util.io.BinaryOut.writeBoolean | ( | boolean | v | ) | throws IOException |
| void joshua.util.io.BinaryOut.writeBuffer | ( | ) | throws IOException [protected] |
| void joshua.util.io.BinaryOut.writeByte | ( | int | v | ) | throws IOException |
| void joshua.util.io.BinaryOut.writeBytes | ( | String | s | ) | throws IOException |
| void joshua.util.io.BinaryOut.writeChar | ( | int | v | ) | throws IOException |
| void joshua.util.io.BinaryOut.writeChars | ( | String | s | ) | throws IOException |
| void joshua.util.io.BinaryOut.writeDouble | ( | double | v | ) | throws IOException |
| void joshua.util.io.BinaryOut.writeFloat | ( | float | v | ) | throws IOException |
| void joshua.util.io.BinaryOut.writeInt | ( | int | v | ) | throws IOException |
| void joshua.util.io.BinaryOut.writeLong | ( | long | v | ) | throws IOException |
| void joshua.util.io.BinaryOut.writeObject | ( | Object | obj | ) | throws IOException |
| void joshua.util.io.BinaryOut.writeShort | ( | int | v | ) | throws IOException |
| void joshua.util.io.BinaryOut.writeUTF | ( | String | str | ) | throws IOException |
| void joshua.util.io.BinaryOut.writeUTF | ( | String | str, |
| long | bytesRequired, | ||
| boolean | forceLongHeader | ||
| ) | throws IOException [private] |
| final int joshua.util.io.BinaryOut.BITS_PER_BYTE = 8 |
| final int joshua.util.io.BinaryOut.BOOLEAN_SIZE = 1 |
final byte [] joshua.util.io.BinaryOut.buffer [private] |
final int joshua.util.io.BinaryOut.BUFFER_SIZE = 1024 [static, private] |
int joshua.util.io.BinaryOut.bufferPosition [private] |
| final int joshua.util.io.BinaryOut.BYTE_SIZE = 1 |
| final int joshua.util.io.BinaryOut.CHAR_SIZE = 2 |
final char [] joshua.util.io.BinaryOut.charBuffer [private] |
final utf8CharRange [] joshua.util.io.BinaryOut.charSizeBuffer [private] |
| final int joshua.util.io.BinaryOut.DOUBLE_SIZE = 8 |
| final int joshua.util.io.BinaryOut.FLOAT_SIZE = 4 |
| final int joshua.util.io.BinaryOut.INT_SIZE = 4 |
final Logger joshua.util.io.BinaryOut.logger = Logger.getLogger(BinaryOut.class.getName()) [static, private] |
| final int joshua.util.io.BinaryOut.LONG_SIZE = 8 |
final OutputStream joshua.util.io.BinaryOut.out [private] |
| final int joshua.util.io.BinaryOut.SHORT_SIZE = 2 |
final boolean joshua.util.io.BinaryOut.writeObjects [private] |