Sunday, 10 March 2013

writeBoolean(boolean)


writeBoolean(boolean)

Declaration:
public void writeBoolean(boolean v)
throws IOException
Description:
Writes a boolean value to this output stream. If the argument v is true, the value (byte)1 is written;
if v is false, the value (byte)0 is written. The byte written by this method may be read by the
readBoolean method of interface DataInput, which will then return a boolean equal to v.
Parameters:
v - the boolean to be written.
Throws:
IOException - if an I/O error occurs.
writeByte(int)
Declaration:
public void writeByte(int v)
throws IOException
Description:
Writes to the output stream the eight low- order bits of the argument v. The 24 high-order bits of v are
ignored. (This means that writeByte does exactly the same thing as write for an integer argument.)
The byte written by this method may be read by the readByte method of interface DataInput, which
will then return a byte equal to (byte)v.
Parameters:
v - the byte value to be written.
Throws:
IOException - if an I/O error occurs.
writeShort(int)
Declaration:
public void writeShort(int v)
throws IOException
Description:
Writes two bytes to the output stream to represent the value of the argument. The byte values to be written,
in the order shown, are:
(byte)(0xff & (v >> 8))
(byte)(0xff & v)
The bytes written by this method may be read by the readShort method of interface DataInput,
which will then return a short equal to (short)v.
Parameters:
v - the short value to be written.
Throws:
IOException - if an I/O error occurs.

writeChar(int)
32
writeChar(int)
Declaration:
public void writeChar(int v)
throws IOException
Description:
Writes a char value, which is comprised of two bytes, to the output stream. The byte values to be written,
in the order shown, are:
(byte)(0xff & (v >> 8))
(byte)(0xff & v)
The bytes written by this method may be read by the readChar method of interface DataInput, which
will then return a char equal to (char)v.
Parameters:
v - the char value to be written.
Throws:
IOException - if an I/O error occurs.
writeInt(int)
Declaration:
public void writeInt(int v)
throws IOException
Description:
Writes an int value, which is comprised of four bytes, to the output stream. The byte values to be written,
in the order shown, are:
(byte)(0xff & (v >> 24))
(byte)(0xff & (v >> 16))
(byte)(0xff & (v >>    8))
(byte)(0xff & v)
The bytes written by this method may be read by the readInt method of interface DataInput, which
will then return an int equal to v.
Parameters:
v - the int value to be written.
Throws:
IOException - if an I/O error occurs.
writeLong(long)
Declaration:
public void writeLong(long v)
throws IOException
Description:
Writes an long value, which is comprised of four bytes, to the output stream. The byte values to be
written, in the order shown, are:

(byte)(0xff & (v >> 56))
(byte)(0xff & (v >> 48))
(byte)(0xff & (v >> 40))
(byte)(0xff & (v >> 32))
(byte)(0xff & (v >> 24))
(byte)(0xff & (v >> 16))
(byte)(0xff & (v >> 8))
(byte)(0xff & v)
The bytes written by this method may be read by the readLong method of interface DataInput, which
will then return a long equal to v.
Parameters:
v - the long value to be written.
Throws:
IOException - if an I/O error occurs.
writeFloat(float)
Declaration:
public void writeFloat(float v)
throws IOException
Description:
Writes a float value, which is comprised of four bytes, to the output stream. It does this as if it first
converts this float value to an int in exactly the manner of the Float.floatToIntBits method
and then writes the int value in exactly the manner of the writeInt method. The bytes written by this
method may be read by the readFloat method of interface DataInput, which will then return a
float equal to v.
Parameters:
v - the float value to be written.
Throws:
IOException - if an I/O error occurs.
Since: CLDC 1.1
writeDouble(double)
Declaration:
public void writeDouble(double v)
throws IOException
Description:
Writes a double value, which is comprised of eight bytes, to the output stream. It does this as if it first
converts this double value to a long in exactly the manner of the Double.doubleToLongBits
method and then writes the long value in exactly the manner of the writeLong method. The bytes
written by this method may be read by the readDouble method of interface DataInput, which will
then return a double equal to v.
Parameters:
v - the double value to be written.
Throws:
IOException - if an I/O error occurs.
Since: CLDC 1.1



No comments:

Post a Comment