|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.io.OutputStream
java.io.FilterOutputStream
org.freehep.util.io.CompressableOutputStream
org.freehep.util.io.BitOutputStream
org.freehep.util.io.ByteOrderOutputStream
public class ByteOrderOutputStream
Class to write bytes and pairs of bytes in both little and big endian order.
| Field Summary | |
|---|---|
protected boolean |
little
|
protected int |
written
|
| Fields inherited from class java.io.FilterOutputStream |
|---|
out |
| Constructor Summary | |
|---|---|
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 |
|
| Method Summary | |
|---|---|
int |
size()
|
void |
write(int b)
|
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. |
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. |
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. |
| Methods inherited from class org.freehep.util.io.BitOutputStream |
|---|
byteAlign, close, finish, flushByte, minBits, minBits, minBits, writeBitFlag, writeFBits, writeSBits, writeUBits |
| Methods inherited from class org.freehep.util.io.CompressableOutputStream |
|---|
startCompressing, write |
| Methods inherited from class java.io.FilterOutputStream |
|---|
flush, write |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface java.io.DataOutput |
|---|
write, write |
| Field Detail |
|---|
protected boolean little
protected int written
| Constructor Detail |
|---|
public ByteOrderOutputStream(OutputStream out)
out - stream to write to
public ByteOrderOutputStream(OutputStream out,
boolean littleEndian)
out - stream to write tolittleEndian - true if stream should be little endian| Method Detail |
|---|
public int size()
throws IOException
IOException - if write fails FIXME, should this throw an exception ?
public void write(int b)
throws IOException
write in interface DataOutputwrite in class BitOutputStreamIOException
public void writeBoolean(boolean b)
throws IOException
writeBoolean in interface DataOutputIOException
public void writeChar(int c)
throws IOException
writeChar in interface DataOutputIOException
public void writeByte(int b)
throws IOException
writeByte in interface DataOutputIOException
public void writeByte(byte[] bytes)
throws IOException
bytes - byte array to be written
IOException - if write fails
public void writeUnsignedByte(int ub)
throws IOException
ub - byte to write
IOException - if write fails
public void writeUnsignedByte(int[] bytes)
throws IOException
bytes - int array to write as bytes
IOException - if write fails
public void writeShort(int s)
throws IOException
writeShort in interface DataOutputIOException
public void writeShort(short[] shorts)
throws IOException
shorts - short array to write
IOException - if write fails
public void writeUnsignedShort(int s)
throws IOException
s - int to write as unsigned short
IOException - if write fails
public void writeUnsignedShort(int[] shorts)
throws IOException
shorts - int array to write as unsigned shorts
IOException - if write fails
public void writeInt(int i)
throws IOException
writeInt in interface DataOutputIOException
public void writeInt(int[] ints)
throws IOException
ints - int array to write
IOException - if write fails
public void writeUnsignedInt(long i)
throws IOException
i - long to write as unsigned int
IOException - if write fails
public void writeUnsignedInt(long[] ints)
throws IOException
ints - long array to write as unsigned ints
IOException - if write fails
public void writeLong(long l)
throws IOException
writeLong in interface DataOutputIOException
public void writeFloat(float f)
throws IOException
writeFloat in interface DataOutputIOException
public void writeDouble(double d)
throws IOException
writeDouble in interface DataOutputIOException
public void writeBytes(String s)
throws IOException
writeBytes in interface DataOutputIOException
public void writeChars(String s)
throws IOException
writeChars in interface DataOutputIOException
public void writeString(String s)
throws IOException
s - string to write
IOException - if write fails
public void writeUTF(String s)
throws IOException
writeUTF in interface DataOutputIOException
public void writeAsciiZString(String s)
throws IOException
s - string to write
IOException - if write fails
public static void writeUTF(String s,
DataOutput dos)
throws IOException
s - string to writedos - stream to write to
IOException - if write fails
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||