Packages  This Package  Prev  Next  Index  

§2.25 Interface DataOutput

public  interface  java.io.DataOutput
{
        // Methods
    public abstract void write(byte  b[]);	§2.25.1
    public abstract void write(byte  b[], int  off, int  len)	§2.25.2
    public abstract void write(int  b);	§2.25.3
    public abstract void writeBoolean(boolean  v);	§2.25.4
    public abstract void writeByte(int  v);	§2.25.5
    public abstract void writeBytes(String  s);	§2.25.6
    public abstract void writeChar(int  v);	§2.25.7
    public abstract void writeChars(String  s);	§2.25.8
    public abstract void writeDouble(double  v);	§2.25.9
    public abstract void writeFloat(float  v);	§2.25.10
    public abstract void writeInt(int  v);	§2.25.11
    public abstract void writeLong(long  v);	§2.25.12
    public abstract void writeShort(int  v);	§2.25.13
    public abstract void writeUTF(String  str);	§2.25.14
}
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:
DataOutputStream (I-§2.6)
DataInput (I-§2.24).

Methods

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 (I-§2.29)
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 (I-§2.29)
If an I/O error occurs.

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 (I-§2.29)
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 (I-§2.29)
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 (I-§2.29)
If an I/O error occurs.

writeBytes

public abstract void writeBytes(String s) throws IOException
Writes out the string to this output stream as a sequence of bytes.
Parameters:
s - the string of bytes to be written
Throws
IOException (I-§2.29)
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 (I-§2.29)
If an I/O error occurs.

writeChars

public abstract void writeChars(String s) throws IOException
Writes a string to this output stream as a sequence of characters.
Parameters:
s - the string value to be written
Throws
IOException (I-§2.29)
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 (I-§2.29)
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 (I-§2.29)
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 (I-§2.29)
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 (I-§2.29)
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 (I-§2.29)
If an I/O error occurs.

writeUTF

public abstract void writeUTF(String str) throws IOException
Writes out a Unicode string that by encoded it using modified UTF-8 format.
Parameters:
str - the string value to be written
Throws
IOException (I-§2.29)
If an I/O error occurs.

Packages  This Package  Prev  Next  Index
Java API Document (HTML generated by dkramer on April 22, 1996)
Copyright © 1996 Sun Microsystems, Inc. All rights reserved
Please send any comments or corrections to doug.kramer@sun.com