|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.mindprod.ledatastream.LEDataOutputStream
public final class LEDataOutputStream
Little-endian version of DataOutputStream.
Very similar to DataOutputStream except it writes little-endian instead of big-endian binary data. We can't extend DataOutputStream directly since it has only final methods. This forces us implement LEDataOutputStream with a DataOutputStream object, and use wrapper methods.
Field Summary | |
---|---|
protected java.io.DataOutputStream |
dis
to get at big-Endian write methods of DataOutPutStream. |
protected byte[] |
work
work array for composing output. |
Constructor Summary | |
---|---|
LEDataOutputStream(java.io.OutputStream out)
constructor. |
Method Summary | |
---|---|
void |
close()
Close stream. |
void |
flush()
Flush stream without closing. |
int |
size()
Get size of stream. |
void |
write(byte[] ba)
Write out an array of bytes. |
void |
write(byte[] ba,
int off,
int len)
Writes out part of an array of bytes. |
void |
write(int ib)
This method writes only one byte, even though it says int (non-Javadoc) |
void |
writeBoolean(boolean v)
Write a booleans as one byte. |
void |
writeByte(int v)
write a byte. |
void |
writeBytes(java.lang.String s)
Write a string. |
void |
writeChar(int v)
Write a char. |
void |
writeChars(java.lang.String s)
Write a string, not a char[]. |
void |
writeDouble(double v)
Write a double. |
void |
writeFloat(float v)
Write a float. |
void |
writeInt(int v)
Write an int, 32-bits. |
void |
writeLong(long v)
Write a long, 64-bits. |
void |
writeShort(int v)
Write short, 16-bits. |
void |
writeUTF(java.lang.String s)
Write a string as a UTF counted string. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final java.io.DataOutputStream dis
protected final byte[] work
Constructor Detail |
---|
public LEDataOutputStream(java.io.OutputStream out)
out
- the outputstream we write little endian binary data onto.Method Detail |
---|
public final void close() throws java.io.IOException
java.io.IOException
- if close fails.public void flush() throws java.io.IOException
java.io.IOException
- if flush fails.public final int size()
public final void write(int ib) throws java.io.IOException
write
in interface java.io.DataOutput
ib
- the byte to write.
java.io.IOException
- if write fails.DataOutput.write(int)
public final void write(byte[] ba) throws java.io.IOException
write
in interface java.io.DataOutput
java.io.IOException
- if write fails.DataOutput.write(byte[])
public final void write(byte[] ba, int off, int len) throws java.io.IOException
write
in interface java.io.DataOutput
java.io.IOException
- if write fails.DataOutput.write(byte[],int,int)
public final void writeBoolean(boolean v) throws java.io.IOException
writeBoolean
in interface java.io.DataOutput
v
- boolean to write.
java.io.IOException
- if write fails.DataOutput.writeBoolean(boolean)
public final void writeByte(int v) throws java.io.IOException
writeByte
in interface java.io.DataOutput
v
- the byte to write.
java.io.IOException
- if write fails.DataOutput.writeByte(int)
public final void writeBytes(java.lang.String s) throws java.io.IOException
writeBytes
in interface java.io.DataOutput
s
- the string to write.
java.io.IOException
- if write fails.DataOutput.writeBytes(java.lang.String)
public final void writeChar(int v) throws java.io.IOException
writeChar
in interface java.io.DataOutput
v
- the char to write
java.io.IOException
- if write fails.public final void writeChars(java.lang.String s) throws java.io.IOException
writeChars
in interface java.io.DataOutput
java.io.IOException
- if write fails.public final void writeDouble(double v) throws java.io.IOException
writeDouble
in interface java.io.DataOutput
v
- the double to write. Like DataOutputStream.writeDouble.
java.io.IOException
- if write fails.public final void writeFloat(float v) throws java.io.IOException
writeFloat
in interface java.io.DataOutput
v
- the float to write.
java.io.IOException
- if write fails.public final void writeInt(int v) throws java.io.IOException
writeInt
in interface java.io.DataOutput
v
- the int to write
java.io.IOException
- if write fails.public final void writeLong(long v) throws java.io.IOException
writeLong
in interface java.io.DataOutput
v
- the long to write
java.io.IOException
- if write fails.public final void writeShort(int v) throws java.io.IOException
writeShort
in interface java.io.DataOutput
v
- the short you want written in little endian binary format
java.io.IOException
- if write fails.public final void writeUTF(java.lang.String s) throws java.io.IOException
writeUTF
in interface java.io.DataOutput
s
- the string to write.
java.io.IOException
- if write fails.DataOutput.writeUTF(java.lang.String)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |