当前页面:
在线文档首页 >
JDK 5 Documentation v1.1.8, Java 2 SDK 英文文档
Interface java.io.DataOutput - JDK 5 Documentation v1.1.8, Java 2 SDK 英文文档
All Packages Class Hierarchy This Package Previous Next Index
Interface java.io.DataOutput
- public interface DataOutput
The data output interface is implemented by streams that can
write primitive Java data types to an output stream in a
machine-independent manner.
- See Also:
- DataInput, DataOutputStream
-
write(byte[])
- Writes
b.length
bytes from the specified byte array
to this output stream.
-
write(byte[], int, int)
- Writes
len
bytes from the specified byte array
starting at offset off
to this output stream.
-
write(int)
- Writes the specified byte to this data output stream.
-
writeBoolean(boolean)
- Writes a
boolean
value to this output stream.
-
writeByte(int)
- Writes an 8-bit value to this output stream.
-
writeBytes(String)
- Writes a string to this output stream.
-
writeChar(int)
- Writes a
char
value to this output stream.
-
writeChars(String)
- Writes a string to this output stream.
-
writeDouble(double)
- Writes a
double
value to this output stream.
-
writeFloat(float)
- Writes a
float
value to this output stream.
-
writeInt(int)
- Writes an
int
value to this output stream.
-
writeLong(long)
- Writes a
long
value to this output stream.
-
writeShort(int)
- Writes a 16-bit value to this output stream.
-
writeUTF(String)
- Writes a Unicode string by encoding it using modified UTF-8 format.
write
public abstract void write(int b) throws IOException
- Writes the specified byte to this data output stream.
- Parameters:
- b - the byte to be written.
- Throws: IOException
- if an I/O error occurs.
write
public abstract void write(byte b[]) throws IOException
- Writes
b.length
bytes from the specified byte array
to this output stream.
- Parameters:
- b - the data.
- Throws: IOException
- if an I/O error occurs.
write
public abstract void write(byte b[],
int off,
int len) throws IOException
- Writes
len
bytes from the specified byte array
starting at offset off
to this output stream.
- Parameters:
- b - the data.
- off - the start offset in the data.
- len - the number of bytes to write.
- Throws: IOException
- if an I/O error occurs.
writeBoolean
public abstract void writeBoolean(boolean v) throws IOException
- Writes a
boolean
value to this output stream.
- Parameters:
- v - the boolean to be written.
- Throws: IOException
- if an I/O error occurs.
writeByte
public abstract void writeByte(int v) throws IOException
- Writes an 8-bit value to this output stream.
- Parameters:
- v - the byte value to be written.
- Throws: IOException
- if an I/O error occurs.
writeShort
public abstract void writeShort(int v) throws IOException
- Writes a 16-bit value to this output stream.
- Parameters:
- v - the
short
value to be written.
- Throws: IOException
- if an I/O error occurs.
writeChar
public abstract void writeChar(int v) throws IOException
- Writes a
char
value to this output stream.
- Parameters:
- v - the
char
value to be written.
- Throws: IOException
- if an I/O error occurs.
writeInt
public abstract void writeInt(int v) throws IOException
- Writes an
int
value to this output stream.
- Parameters:
- v - the
int
value to be written.
- Throws: IOException
- if an I/O error occurs.
writeLong
public abstract void writeLong(long v) throws IOException
- Writes a
long
value to this output stream.
- Parameters:
- v - the
long
value to be written.
- Throws: IOException
- if an I/O error occurs.
writeFloat
public abstract void writeFloat(float v) throws IOException
- Writes a
float
value to this output stream.
- Parameters:
- v - the
float
value to be written.
- Throws: IOException
- if an I/O error occurs.
writeDouble
public abstract void writeDouble(double v) throws IOException
- Writes a
double
value to this output stream.
- Parameters:
- v - the
double
value to be written.
- Throws: IOException
- if an I/O error occurs.
writeBytes
public abstract void writeBytes(String s) throws IOException
- Writes a string to this output stream.
- Parameters:
- s - the string of bytes to be written.
- Throws: IOException
- if an I/O error occurs.
writeChars
public abstract void writeChars(String s) throws IOException
- Writes a string to this output stream.
- Parameters:
- s - the string value to be written.
- Throws: IOException
- if an I/O error occurs.
writeUTF
public abstract void writeUTF(String str) throws IOException
- Writes a Unicode string by encoding it using modified UTF-8 format.
- Parameters:
- str - the string value to be written.
- Throws: IOException
- if an I/O error occurs.
All Packages Class Hierarchy This Package Previous Next Index
Submit a bug or feature - Version 1.1.8 of Java Platform API Specification
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.
Copyright 1995-1999 Sun Microsystems, Inc. 901 San Antonio Road,
Palo Alto, California, 94303, U.S.A. All Rights Reserved.