public class BinaryOutputStream extends OutputStream
| Modifier and Type | Field and Description |
|---|---|
protected int |
count |
protected OutputStream |
output |
protected int |
value |
| Constructor and Description |
|---|
BinaryOutputStream(OutputStream output)
Write out data in big-endian format.
|
| Modifier and Type | Method and Description |
|---|---|
static String |
bin2str(int v) |
void |
close() |
void |
flush() |
static void |
main(String[] argss) |
void |
pad_u8()
Pad out stream to nearest byte boundary
|
void |
write_bit(boolean bit) |
void |
write_u16(int w)
Write an unsigned integer value using 16bits using a big-endian encoding.
|
void |
write_u32(int w)
Write an unsigned integer value using 32bits using a big-endian encoding.
|
void |
write_u8(int w)
Write an unsigned integer value using 8bits using a big-endian encoding.
|
void |
write_un(int bits,
int n)
Write an unsigned integer value using n bits using a big-endian encoding.
|
void |
write_uv(int w)
Write an unsigned integer value using a variable amount of space.
|
void |
write(byte[] bytes) |
void |
write(byte[] bytes,
int offset,
int length) |
void |
write(int i)
Write an unsigned integer value using 8bits using a big-endian encoding.
|
protected OutputStream output
protected int value
protected int count
public BinaryOutputStream(OutputStream output)
output - public void write(int i)
throws IOException
write in class OutputStreami - Unsigned integer value to writeIOExceptionpublic void write(byte[] bytes)
throws IOException
write in class OutputStreamIOExceptionpublic void write(byte[] bytes,
int offset,
int length)
throws IOException
write in class OutputStreamIOExceptionpublic void write_u8(int w)
throws IOException
w - IOExceptionpublic void write_u16(int w)
throws IOException
w - IOExceptionpublic void write_u32(int w)
throws IOException
w - IOExceptionpublic void write_uv(int w)
throws IOException
w - --- number to convert (which cannot be negative)IOExceptionpublic void write_un(int bits,
int n)
throws IOException
bits - The bits to be written to the streamn - the number of bits to writeIOExceptionpublic void write_bit(boolean bit)
throws IOException
IOExceptionpublic void pad_u8()
throws IOException
IOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class OutputStreamIOExceptionpublic void flush()
throws IOException
flush in interface Flushableflush in class OutputStreamIOExceptionpublic static String bin2str(int v)
public static void main(String[] argss)
Copyright © 2016. All rights reserved.