api / tv.twelvetone.io / Writer / write

write

open fun write(c: Int): Unit

Writes a single character. The character to be written is contained in the 16 low-order bits of the given integer value; the 16 high-order bits are ignored.

Subclasses that intend to support efficient single-character output should override this method.

Parameters

c - int specifying a character to be written

Exceptions

IOException - If an I/O error occurs fun write(cbuf: CharArray): Unit

Writes an array of characters.

Parameters

cbuf - Array of characters to be written

Exceptions

IOException - If an I/O error occurs abstract fun write(cbuf: CharArray, off: Int, len: Int): Unit

Writes a portion of an array of characters.

Parameters

cbuf - Array of characters off - Offset from which to start writing characters len - Number of characters to write

Exceptions

IOException - If an I/O error occurs fun write(str: String): Unit

Writes a string.

Parameters

str - String to be written

Exceptions

IOException - If an I/O error occurs open fun write(str: String, off: Int, len: Int): Unit

Writes a portion of a string.

Parameters

str - A String off - Offset from which to start writing characters len - Number of characters to write

Exceptions

IndexOutOfBoundsException - If off is negative, or len is negative, or off+len is negative or greater than the length of the given string IOException - If an I/O error occurs