public class ByteOrderOutputStream extends BitOutputStream implements DataOutput
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
little |
protected int |
written |
out| Constructor and Description |
|---|
ByteOrderOutputStream(OutputStream out)
Create a (Big Endian) Byte Order output stream from given stream
|
ByteOrderOutputStream(OutputStream out,
boolean littleEndian)
Create a Byte Order output stream from the given stream
|
| Modifier and Type | Method and Description |
|---|---|
int |
size() |
void |
writeAsciiZString(String s)
Write an ascii-z (0 terminated c-string).
|
void |
writeBoolean(boolean b) |
void |
writeByte(byte[] bytes)
Writes array of bytes
|
void |
writeByte(int b)
Write a signed byte.
|
protected void |
writeByteArray(byte[] bytes,
int offset,
int length) |
void |
writeBytes(String s) |
void |
writeChar(int c) |
void |
writeChars(String s) |
void |
writeDouble(double d) |
void |
writeFloat(float f) |
void |
writeInt(int i)
Write a signed integer.
|
void |
writeInt(int[] ints)
Write an array of ints
|
void |
writeLong(long l) |
void |
writeShort(int s)
Write a signed short.
|
void |
writeShort(short[] shorts)
Write an array of shorts.
|
protected void |
writeSingleByte(int b) |
void |
writeString(String s)
Write a string (UTF)
|
void |
writeUnsignedByte(int ub)
Write an unsigned byte.
|
void |
writeUnsignedByte(int[] bytes)
Write an array of unsigned bytes.
|
void |
writeUnsignedInt(long i)
Write an unsigned integer.
|
void |
writeUnsignedInt(long[] ints)
Write an array of unsigned ints
|
void |
writeUnsignedShort(int s)
Write an unsigned short.
|
void |
writeUnsignedShort(int[] shorts)
Write an array of unsigned shorts.
|
void |
writeUTF(String s) |
static void |
writeUTF(String s,
DataOutput dos)
Write a UTF string to the data output stream.
|
byteAlign, close, finish, flushByte, minBits, minBits, minBits, writeBitFlag, writeFBits, writeSBits, writeUBitsstartCompressing, write, writeflush, writeclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitwrite, write, writepublic ByteOrderOutputStream(OutputStream out)
out - stream to write topublic ByteOrderOutputStream(OutputStream out, boolean littleEndian)
out - stream to write tolittleEndian - true if stream should be little endianpublic int size()
throws IOException
IOException - if write fails FIXME, should this throw an exception ?protected void writeSingleByte(int b)
throws IOException
writeSingleByte in class CompressableOutputStreamIOExceptionprotected void writeByteArray(byte[] bytes,
int offset,
int length)
throws IOException
writeByteArray in class CompressableOutputStreamIOExceptionpublic void writeBoolean(boolean b)
throws IOException
writeBoolean in interface DataOutputIOExceptionpublic void writeChar(int c)
throws IOException
writeChar in interface DataOutputIOExceptionpublic void writeByte(int b)
throws IOException
writeByte in interface DataOutputIOExceptionpublic void writeByte(byte[] bytes)
throws IOException
bytes - byte array to be writtenIOException - if write failspublic void writeUnsignedByte(int ub)
throws IOException
ub - byte to writeIOException - if write failspublic void writeUnsignedByte(int[] bytes)
throws IOException
bytes - int array to write as bytesIOException - if write failspublic void writeShort(int s)
throws IOException
writeShort in interface DataOutputIOExceptionpublic void writeShort(short[] shorts)
throws IOException
shorts - short array to writeIOException - if write failspublic void writeUnsignedShort(int s)
throws IOException
s - int to write as unsigned shortIOException - if write failspublic void writeUnsignedShort(int[] shorts)
throws IOException
shorts - int array to write as unsigned shortsIOException - if write failspublic void writeInt(int i)
throws IOException
writeInt in interface DataOutputIOExceptionpublic void writeInt(int[] ints)
throws IOException
ints - int array to writeIOException - if write failspublic void writeUnsignedInt(long i)
throws IOException
i - long to write as unsigned intIOException - if write failspublic void writeUnsignedInt(long[] ints)
throws IOException
ints - long array to write as unsigned intsIOException - if write failspublic void writeLong(long l)
throws IOException
writeLong in interface DataOutputIOExceptionpublic void writeFloat(float f)
throws IOException
writeFloat in interface DataOutputIOExceptionpublic void writeDouble(double d)
throws IOException
writeDouble in interface DataOutputIOExceptionpublic void writeBytes(String s) throws IOException
writeBytes in interface DataOutputIOExceptionpublic void writeChars(String s) throws IOException
writeChars in interface DataOutputIOExceptionpublic void writeString(String s) throws IOException
s - string to writeIOException - if write failspublic void writeUTF(String s) throws IOException
writeUTF in interface DataOutputIOExceptionpublic void writeAsciiZString(String s) throws IOException
s - string to writeIOException - if write failspublic static void writeUTF(String s, DataOutput dos) throws IOException
s - string to writedos - stream to write toIOException - if write failsCopyright © 2016. All rights reserved.