write

expect abstract fun write(buf: ByteArray)(source)

Writes the entire contents of buf to the File for which this stream belongs. Bytes are written starting at the current FileStream.position. The FileStream.position will automatically increment by the number of bytes that were written.

Parameters

buf

The array of data to write.

Throws

If an I/O error occurs, or the stream is closed.


expect abstract fun write(buf: ByteArray, offset: Int, len: Int)(source)

Writes len number of bytes from buf, starting at index offset, to the File for which this stream belongs. Bytes are written starting at the current FileStream.position. The FileStream.position will automatically increment by the number of bytes that were written.

Parameters

buf

The array of data to write.

offset

The index in buf to start at when writing data.

len

The number of bytes from buf, starting at index offset, to write.

Throws

If an I/O error occurs, or the stream is closed.

IndexOutOfBoundsException

If offset or len are inappropriate.


expect abstract fun write(buf: ByteArray, position: Long)(source)

Writes the entire contents of buf to the File for which this stream belongs. Bytes are written starting at the specified position. The FileStream.position will not be changed. If the specified position is greater than the current size, then the File is grown to accommodate the new data. The values of any bytes between the previous end-of-file and the newly written data are unspecified.

Parameters

buf

The array of data to write.

position

The file offset (from the start of the File) to begin writing at.

Throws

IllegalArgumentException

If position is less than 0.

If an I/O error occurs, or the stream is closed.


expect abstract fun write(buf: ByteArray, offset: Int, len: Int, position: Long)(source)

Writes len number of bytes from buf, starting at index offset, to the File for which this stream belongs. Bytes are written starting at the specified position. The FileStream.position will not be changed. If the specified position is greater than the current size, then the File is grown to accommodate the new data. The values of any bytes between the previous end-of-file and the newly written data are unspecified.

Parameters

buf

The array of data to write.

position

The file offset (from the start of the File) to begin writing at.

Throws

IllegalArgumentException

If position is less than 0.

If an I/O error occurs, or the stream is closed.

abstract fun write(buf: Buffer)(source)

Writes the entire contents of buf to the File for which this stream belongs. Bytes are written starting at the current FileStream.position. The FileStream.position will automatically increment by the number of bytes that were written.

Parameters

buf

The buffer of data to write.

Throws

If an I/O error occurs, or the stream is closed.


abstract fun write(buf: Buffer, offset: Long, len: Long)(source)

Writes len number of bytes from buf, starting at index offset, to the File for which this stream belongs. Bytes are written starting at the current FileStream.position. The FileStream.position will automatically increment by the number of bytes that were written.

Parameters

buf

The buffer of data to write.

offset

The index in buf to start at when writing data.

len

The number of bytes from buf, starting at index offset, to write.

Throws

If an I/O error occurs, or the stream is closed.

IndexOutOfBoundsException

If offset or len are inappropriate.


abstract fun write(buf: Buffer, position: Long)(source)

Writes the entire contents of buf to the File for which this stream belongs. Bytes are written starting at the specified position. The FileStream.position will not be changed. If the specified position is greater than the current size, then the File is grown to accommodate the new data. The values of any bytes between the previous end-of-file and the newly written data are unspecified.

Parameters

buf

The buffer of data to write.

position

The file offset (from the start of the File) to begin writing at.

Throws

IllegalArgumentException

If position is less than 0.

If an I/O error occurs, or the stream is closed.


abstract fun write(buf: Buffer, offset: Long, len: Long, position: Long)(source)

Writes len number of bytes from buf, starting at index offset, to the File for which this stream belongs. Bytes are written starting at the specified position. The FileStream.position will not be changed. If the specified position is greater than the current size, then the File is grown to accommodate the new data. The values of any bytes between the previous end-of-file and the newly written data are unspecified.

Parameters

buf

The buffer of data to write.

position

The file offset (from the start of the File) to begin writing at.

Throws

IllegalArgumentException

If position is less than 0.

If an I/O error occurs, or the stream is closed.


actual abstract fun write(buf: ByteArray)(source)
actual abstract fun write(buf: ByteArray, offset: Int, len: Int)(source)
actual abstract fun write(buf: ByteArray, position: Long)(source)
actual abstract fun write(buf: ByteArray, offset: Int, len: Int, position: Long)(source)
abstract override fun write(src: ByteBuffer?): Int(source)

Writes the available contents of src to the File for which this stream belongs. Bytes are written starting at the current FileStream.position. The FileStream.position will automatically increment by the number of bytes that were written.

Otherwise, this function behaves as specified in WritableByteChannel.


abstract fun write(src: ByteBuffer?, position: Long): Int(source)

Writes the available contents of src to the File for which this stream belongs. Bytes are written starting at the specified position. The FileStream.position will not be changed. If the specified position is greater than the current size, then the File is grown to accommodate the new data. The values of any bytes between the previous end-of-file and the newly written data are unspecified.

Otherwise, this function behaves as specified in java.nio.channels.FileChannel.write.

Parameters

src

The buffer of data to write.

position

The file offset (from the start of the File) to begin writing at.

Throws

IllegalArgumentException

If position is less than 0.

If an I/O error occurs.


actual abstract fun write(buf: ByteArray)(source)
actual abstract fun write(buf: ByteArray, offset: Int, len: Int)(source)
actual abstract fun write(buf: ByteArray, position: Long)(source)
actual abstract fun write(buf: ByteArray, offset: Int, len: Int, position: Long)(source)
actual abstract fun write(buf: ByteArray)(source)
actual abstract fun write(buf: ByteArray, offset: Int, len: Int)(source)
actual abstract fun write(buf: ByteArray, position: Long)(source)
actual abstract fun write(buf: ByteArray, offset: Int, len: Int, position: Long)(source)