BufferedOutputStream

open class BufferedOutputStream(val out: OutputStream, bufferSize: Int = 8192) : OutputStream(source)

The class implements a buffered output stream. By setting up such an output stream, an application can write bytes to the underlying output stream without necessarily causing a call to the underlying system for each byte written.

Since

0.1.0

Parameters

out

the underlying output stream.

bufferSize

the buffer size.

Constructors

Link copied to clipboard
constructor(out: OutputStream, bufferSize: Int = 8192)

Creates a new buffered output stream to write data to the

Properties

Link copied to clipboard
protected var count: Int

The number of valid bytes in the buffer. This value is always in the range 0 through buf.length; elements buf[0] through buf[count-1] contain valid byte data.

Link copied to clipboard

The underlying output stream to be filtered.

Functions

Link copied to clipboard
open override fun close()

Closes this buffered output stream. This method simply flushes this stream and then calls the underlying output stream's close method, which releases the underlying output stream's resources.

Link copied to clipboard
open override fun flush()

Flushes this buffered output stream. This forces any buffered output bytes to be written out to the underlying output stream.

Link copied to clipboard
open override fun write(b: ByteArray)

Writes b.length bytes from the specified byte array to this buffered output stream.

open override fun write(b: Int)

Writes the specified byte to this buffered output stream.

open override fun write(b: ByteArray, off: Int, len: Int)

Writes len bytes from the specified byte array starting at offset off to this buffered output stream.