java.io.DataOutput
None
java.io.ObjectOutput
java.io.DataOutputStream, java.io.RandomAccessFile
JDK 1.0 or later
The DataOutput interface defines methods for writing primitive data types to an output stream in a machine-independent manner. All multibyte quantities are written in a format that stores the most significant byte as the first byte and the least significant byte as the last byte.
public abstract interface java.io.DataOutput { // Methods public abstract void write(byte[] b); public abstract void write(byte[] b, int off, int len); public abstract void write(int b); public abstract void writeBoolean(boolean v); public abstract void writeByte(int v); public abstract void writeBytes(String s); public abstract void writeChar(int v); public abstract void writeChars(String s); public abstract void writeDouble(double v); public abstract void writeFloat(float v); public abstract void writeInt(int v); public abstract void writeLong(long v); public abstract void writeShort(int v); public abstract void writeUTF(String str); }
The value to write.
If any kind of I/O error occurs.
This method writes the low-order 8 bits of the given integer b.
An array of values to write.
If any kind of I/O error occurs.
This method writes all of the 8-bit bytes in the given array.
public abstract void write(byte[] b, int off, int len) throws IOException
An array of values to write.
An offset into the array.
The number of bytes to write.
If any kind of I/O error occurs.
This method writes len bytes from the given array, starting off elements from the beginning of the array.
The boolean value to write.
If any kind of I/O error occurs.
If v is true, this method writes a byte that contains the value 1. If v is false, the method writes a byte that contains the value 0.
The value to write.
If any kind of I/O error occurs.
This method writes an 8-bit byte using the low-order eight bits of the integer v.
The String to write.
If any kind of I/O error occurs.
This method writes the characters in the given String as a sequence of 8-bit bytes. The high-order bytes of the characters in the string are ignored.
The value to write.
If any kind of I/O error occurs.
This method writes a 16-bit char using the low-order 16 bits of the given integer v.
The String to write.
If any kind of I/O error occurs.
This method writes the characters in the given String object as a sequence of 16-bit characters.
The double value to write.
If any kind of I/O error occurs.
This method writes a 64-bit double.
The value to write.
If any kind of I/O error occurs.
This method writes a 32-bit float.
The int value to write.
If any kind of I/O error occurs.
This method writes a 32-bit int.
The long value to write.
If any kind of I/O error occurs.
This method writes a 64-bit long.
The short value to write.
If any kind of I/O error occurs.
This method writes a 16-bit short.
The String to write.
If any kind of I/O error occurs.
This method writes the given String using UTF-8 encoding. See Appendix B, The UTF-8 Encoding for information on the UTF-8 encoding.
DataOutputStream, IOException, ObjectOutput, RandomAccessFile