public interface DataOutput
MUTF-8 encoded strings.DataOutputStream,
RandomAccessFile| Modifier and Type | Method and Description |
|---|---|
void |
write(byte[] buffer)
Writes the entire contents of the byte array
buffer to this
stream. |
void |
write(byte[] buffer,
int offset,
int count)
Writes
count bytes from the byte array buffer starting at
offset index. |
void |
write(int oneByte)
Writes the specified 8-bit byte.
|
void |
writeBoolean(boolean val)
Writes the specified boolean.
|
void |
writeByte(int val)
Writes the specified 8-bit byte.
|
void |
writeBytes(String str)
Writes the low order 8-bit bytes from the specified string.
|
void |
writeChar(int val)
Writes the specified 16-bit character in big-endian order.
|
void |
writeChars(String str)
Writes the 16-bit characters contained in
str in big-endian order. |
void |
writeDouble(double val)
Writes the specified 64-bit double in big-endian order.
|
void |
writeFloat(float val)
Writes the specified 32-bit float in big-endian order.
|
void |
writeInt(int val)
Writes the specified 32-bit int in big-endian order.
|
void |
writeLong(long val)
Writes the specified 64-bit long in big-endian order.
|
void |
writeShort(int val)
Writes the specified 16-bit short in big-endian order.
|
void |
writeUTF(String str)
Writes the specified string encoded in
modified UTF-8. |
void write(byte[] buffer)
throws IOException
buffer to this
stream.buffer - the buffer to write.IOException - if an I/O error occurs while writing.void write(byte[] buffer,
int offset,
int count)
throws IOException
count bytes from the byte array buffer starting at
offset index.buffer - the buffer to write.offset - the index of the first byte in buffer to write.count - the number of bytes from the buffer to write.IOException - if an I/O error occurs while writing.void write(int oneByte)
throws IOException
oneByte - the byte to write.IOException - if an I/O error occurs while writing.DataInput.readByte()void writeBoolean(boolean val)
throws IOException
val - the boolean value to write.IOException - if an I/O error occurs while writing.DataInput.readBoolean()void writeByte(int val)
throws IOException
val - the byte value to write.IOException - if an I/O error occurs while writing.DataInput.readByte(),
DataInput.readUnsignedByte()void writeBytes(String str) throws IOException
str - the string containing the bytes to write.IOException - if an I/O error occurs while writing.void writeChar(int val)
throws IOException
oneByte are written.val - the character to write.IOException - if an I/O error occurs while writing.DataInput.readChar()void writeChars(String str) throws IOException
str in big-endian order.str - the string that contains the characters to write.IOException - if an I/O error occurs while writing.DataInput.readChar()void writeDouble(double val)
throws IOException
Double.doubleToLongBits(double).val - the double to write.IOException - if an I/O error occurs while writing.DataInput.readDouble()void writeFloat(float val)
throws IOException
Float.floatToIntBits(float).val - the float to write.IOException - if an I/O error occurs while writing.DataInput.readFloat()void writeInt(int val)
throws IOException
val - the int to write.IOException - if an I/O error occurs while writing.DataInput.readInt()void writeLong(long val)
throws IOException
val - the long to write.IOException - if an I/O error occurs while writing.DataInput.readLong()void writeShort(int val)
throws IOException
val are written.val - the short to write.IOException - if an I/O error occurs while writing.DataInput.readShort(),
DataInput.readUnsignedShort()void writeUTF(String str) throws IOException
modified UTF-8.str - the string to write encoded in modified UTF-8.IOException - if an I/O error occurs while writing.DataInput.readUTF()