Writer.write

Overview | Methods | This Package | All Packages

Writer.write

Writes the specified item to the text stream.

Syntax

public void write( char value )

public void write( char[] buffer )

public void write( char[] buffer, int index, int count )

public void write( boolean b_value )

public void write( int i_value )

public void write( long l_value )

public void write( float f_value )

public void write( double d_value )

public void write( String s_value )

public void write( Object o_value )

Parameters

value

The character to write to the text stream.

buffer

The character array to write to the text stream.

index

The starting index in the buffer.

count

The number of characters to write.

b_value

The boolean value to write.

i_value

The integer to write. The text of  i_value is produced by calling the Integer.toString(int) method.

l_value

The long to write. The text of  l_value is produced by calling the Long.toString(long) method.

f_value

The float to write. The text of  f_value is produced by calling the Float.toString(float) method.

d_value

The double to write. The text of  d_value is produced by calling the Double.toString(double) method.

s_value

The string to write. If the specified string is null, nothing is written to the text stream.

o_value

The object to write.

Remarks

The default method is empty, but a subclass can override this method to provide the appropriate functionality. The second method syntax calls write(char) for each of the characters in the character array. If the character array is null, nothing is written. The third method syntax writes count characters of data into this Writer object from the buffer character array starting at position index. The fourth method syntax outputs either the string "true" or the string "false".

If the o_value is null, the string "null" is written to the text stream. Otherwise, the object's toString method is called to produce the string representation, and the resulting string is then written to the output stream.