|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.io.OutputStream
java.io.FilterOutputStream
java.io.DataOutputStream
public class DataOutputStream
DataOutputStream is a filter class which can write typed data to a Stream. Typically, this stream can be read in by a DataInputStream. Types that can be written include byte, 16-bit short, 32-bit int, 32-bit float, 64-bit long, 64-bit double, byte strings, and UTF Strings.
DataInputStream| Field Summary | |
|---|---|
(package private) static int |
MAX_BUF_SIZE
|
protected int |
written
The number of bytes written out so far |
| Fields inherited from class java.io.FilterOutputStream |
|---|
out |
| Constructor Summary | |
|---|---|
DataOutputStream(OutputStream out)
Constructs a new DataOutputStream on the OutputStream out. |
|
| Method Summary | |
|---|---|
(package private) long |
countUTFBytes(String str)
|
void |
flush()
Flush this DataOutputStream to ensure all pending data is sent out to the target OutputStream. |
int |
size()
Returns the total number of bytes written to this stream thus far. |
void |
write(byte[] buffer,
int offset,
int count)
Writes count bytes from the byte array
buffer starting at offset index to the
OutputStream. |
void |
write(int oneByte)
Writes the specified byte to the OutputStream. |
void |
writeBoolean(boolean val)
Writes a boolean to this output stream. |
void |
writeByte(int val)
Writes a 8-bit byte to this output stream. |
void |
writeBytes(String str)
Writes the low order 8-bit bytes from a String to this output stream. |
void |
writeChar(int val)
Writes the specified 16-bit character to the OutputStream. |
void |
writeChars(String str)
Writes the specified 16-bit characters contained in str to the OutputStream. |
void |
writeDouble(double val)
Writes a 64-bit double to this output stream. |
void |
writeFloat(float val)
Writes a 32-bit float to this output stream. |
void |
writeInt(int val)
Writes a 32-bit int to this output stream. |
void |
writeLong(long val)
Writes a 64-bit long to this output stream. |
void |
writeShort(int val)
Writes the specified 16-bit short to the OutputStream. |
void |
writeUTF(String str)
Writes the specified String out in UTF format. |
(package private) void |
writeUTFBytes(String str,
long count)
|
| Methods inherited from class java.io.FilterOutputStream |
|---|
close, 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 |
| Field Detail |
|---|
protected int written
static final int MAX_BUF_SIZE
| Constructor Detail |
|---|
public DataOutputStream(OutputStream out)
out.
All writes can now be filtered through this stream. Note that data
written by this Stream is not in a human readable format but can be
reconstructed by using a DataInputStream on the resulting output.
out - the target OutputStream to filter writes on.| Method Detail |
|---|
public void flush()
throws IOException
flush in interface Flushableflush in class FilterOutputStreamIOException - If an error occurs attempting to flush this DataOutputStream.public final int size()
public void write(byte[] buffer,
int offset,
int count)
throws IOException
count bytes from the byte array
buffer starting at offset index to the
OutputStream.
write in interface DataOutputwrite in class FilterOutputStreambuffer - the buffer to be writtenoffset - offset in buffer to get bytescount - number of bytes in buffer to write
IOException - If an error occurs attempting to write to this
DataOutputStream.DataInput.readFully(byte[]),
DataInput.readFully(byte[], int, int)
public void write(int oneByte)
throws IOException
byte to the OutputStream.
write in interface DataOutputwrite in class FilterOutputStreamoneByte - the byte to be written
IOException - If an error occurs attempting to write to this
DataOutputStream.DataInput.readByte()
public final void writeBoolean(boolean val)
throws IOException
writeBoolean in interface DataOutputval - the boolean value to write to the OutputStream
IOException - If an error occurs attempting to write to this
DataOutputStream.DataInput.readBoolean()
public final void writeByte(int val)
throws IOException
writeByte in interface DataOutputval - the byte value to write to the OutputStream
IOException - If an error occurs attempting to write to this
DataOutputStream.DataInput.readByte(),
DataInput.readUnsignedByte()
public final void writeBytes(String str)
throws IOException
writeBytes in interface DataOutputstr - the String containing the bytes to write to the OutputStream
IOException - If an error occurs attempting to write to this
DataOutputStream.DataInput.readFully(byte[]),
DataInput.readFully(byte[],int,int)
public final void writeChar(int val)
throws IOException
writeChar in interface DataOutputval - the character to be written
IOException - If an error occurs attempting to write to this
DataOutputStream.DataInput.readChar()
public final void writeChars(String str)
throws IOException
writeChars in interface DataOutputstr - the String whose characters are to be written.
IOException - If an error occurs attempting to write to this
DataOutputStream.DataInput.readChar()
public final void writeDouble(double val)
throws IOException
writeDouble in interface DataOutputval - the double to be written.
IOException - If an error occurs attempting to write to this
DataOutputStream.DataInput.readDouble()
public final void writeFloat(float val)
throws IOException
writeFloat in interface DataOutputval - the float to be written.
IOException - If an error occurs attempting to write to this
DataOutputStream.DataInput.readFloat()
public final void writeInt(int val)
throws IOException
writeInt in interface DataOutputval - the int to be written.
IOException - If an error occurs attempting to write to this
DataOutputStream.DataInput.readInt()
public final void writeLong(long val)
throws IOException
writeLong in interface DataOutputval - the long to be written.
IOException - If an error occurs attempting to write to this
DataOutputStream.DataInput.readLong()
public final void writeShort(int val)
throws IOException
writeShort in interface DataOutputval - the short to be written
IOException - If an error occurs attempting to write to this
DataOutputStream.DataInput.readShort(),
DataInput.readUnsignedShort()
public final void writeUTF(String str)
throws IOException
writeUTF in interface DataOutputstr - the String to be written in UTF format.
IOException - If an error occurs attempting to write to this
DataOutputStream.DataInput.readUTF()long countUTFBytes(String str)
void writeUTFBytes(String str,
long count)
throws IOException
IOException
|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||