BufferedInputStream

class BufferedInputStream(input: InputStream, maxBuffer: Int = 8192) : InputStream(source)

A BufferedInputStream is created from an InputStream and buffers the data to make reading faster. (It's recommended to use this class if you want to read data from a InputStream)

Since

0.1.0

Parameters

input

The InputStream to buffer

maxBuffer

The size of the buffer (default: 8192)

See also

Constructors

Link copied to clipboard
constructor(input: InputStream, maxBuffer: Int = 8192)

Properties

Link copied to clipboard

Returns a BufferedInputStream that reads from this input stream.

Link copied to clipboard

Returns a CountingInputStream that reads from this input stream.

Link copied to clipboard

Returns a DataInputStream that reads from this input stream.

Link copied to clipboard

Returns a BufferedInputStream that reads from this input stream.

Functions

Link copied to clipboard

Returns a BufferedInputStream that reads from this input stream.

Link copied to clipboard

Returns a CountingInputStream that reads from this input stream.

Link copied to clipboard

Returns a DataInputStream that reads from this input stream.

Link copied to clipboard
open override fun available(): Int

Returns an estimate of the number of bytes that can be read (or skipped over) from this input stream without blocking by the next invocation of a method for this input stream.

Link copied to clipboard
open override fun close()

Closes the BufferedInputStream and the InputStream it was created from

Link copied to clipboard
open override fun mark(readlimit: Int)

Marks the current position in this input stream.

Link copied to clipboard
open override fun markSupported(): Boolean

Checks if the input stream supports marking/resetting

Link copied to clipboard
fun peek(): Int
Link copied to clipboard
open override fun read(): Int

Reads a single byte from the BufferedInputStream

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

Reads bytes from the BufferedInputStream into the given array

Link copied to clipboard
open override fun readNBytes(n: Int): ByteArray

Reads bytes from the BufferedInputStream into the given array

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

Reads up to len bytes of data from the input stream into an array of bytes.

Link copied to clipboard
open override fun reset()

Resets this input stream to the position at the time the mark method was last called on this input stream.

Link copied to clipboard
open override fun skip(n: Long): Long

Skips over and discards n bytes of data from this input stream.

Link copied to clipboard
open override fun toString(): String