Saturday, 9 March 2013

Methods write(int)


Methods
write(int)

Declaration:
public void write(int b)
throws IOException
Description:
Writes to the output stream the eight low-order bits of the argument b. The 24 high-order bits of b are
ignored.
Parameters:
b - the byte to be written.
Throws:
IOException - if an I/O error occurs.
write(byte[])
Declaration:
public void write(byte[] b)
throws IOException
Description:
Writes to the output stream all the bytes in array b. If b is null, a NullPointerException is thrown.
If b.length is zero, then no bytes are written. Otherwise, the byte b[0] is written first, then b[1], and
so on; the last byte written is b[b.length-1].
Parameters:
b - the data.
Throws:
IOException - if an I/O error occurs.
write(byte[], int, int)

Declaration:
public void write(byte[] b, int off, int len)
throws IOException
Description:
Writes len bytes from array b, in order, to the output stream. If b is null, a NullPointerException
is thrown. If off is negative, or len is negative, or off+len is greater than the length of the array b, then
an IndexOutOfBoundsException is thrown. If len is zero, then no bytes are written. Otherwise, the
byte b[off] is written first, then b[off+1], and so on; the last byte written is b[off+len-1].
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.

No comments:

Post a Comment