DefaultTextInputStream (class)
public DefaultTextInputStream {inherits {DefaultBufferedInputStream-of char}, TextInputStream}
Package: CURL.IO.STREAM

This is a generic full implementation of a TextInputStream that takes an unbuffered {InputStream-of char} and buffers calls to it.


Constructors
default:
constructor public {DefaultTextInputStream.default
    stream:{InputStream-of char},
    close-stream-on-close?:bool = true,
    buffer-size:int = {calculate-instances-per-memory-size default-buffer-memory-size, char },
    unread-size:int = {max {min 4, buffer-size div 4}, 1}
}
Properties
character-encoding:Current character encoding of bytes being read; defines how those bytes are being transcoded into characters.
accessor public DefaultTextInputStream.character-encoding:CharEncoding
Properties inherited from DefaultBufferedInputStream-of: fill-data-allow-short-read-supported?, fill-data-non-blocking-supported?, open?, origin-url, underlying-input-stream, when-last-modified
Properties inherited from InputStreamBuffer-of: _buffer-valid-end, _seen-eof?, non-blocking-supported?, read-buffer-data-size, read-buffer-empty?, read-buffer-size, unread-size
Properties inherited from StreamBuffer-of: _buffer, _buffer-location, _buffer-valid-start, _seek-location
Properties inherited from PeekableInputStream-of: end-of-stream?
Methods
Methods inherited from DefaultBufferedInputStream-of: close, fill-data
Methods inherited from TextInputStream: async-read-string, read-line, read-lines, read-one-line, read-one-string
Methods inherited from InputStreamBuffer-of: async-read, clear-buffer, do-buffer-fill-data, read, read-one, resize-buffer, set-unread-size, unread-one
Methods inherited from BufferedInputStream-of: peek-one, peek-one-any, unread-one-any
Methods inherited from InputStream-of: copy-out, read-anys, read-one-any, to-Iterator
Methods inherited from Stream-of: verify-open
Methods inherited from Object: object-describe, object-describe-for-debugging, object-serialize

Constructor Details
default (constructor)
public {DefaultTextInputStream.default
    stream:{InputStream-of char},
    close-stream-on-close?:bool = true,
    buffer-size:int = {calculate-instances-per-memory-size default-buffer-memory-size, char },
    unread-size:int = {max {min 4, buffer-size div 4}, 1}
}
stream: InputStream-of char to be wrapped by buffering.
close-stream-on-close?: specifies whether this class's close method should invoke close on the underlying stream.
buffer-size: Approximately how many items the main buffer should hold. Must be greater than 0.
unread-size: Approximately how many items should be able to be held for successive unread-one operations.

Notes

The amount of space available for unreading can grow dynamically, but such growth is expensive. Unread space is never used for other purposes. The main buffer will not grow.


Property Details
character-encoding (accessor)
accessor public DefaultTextInputStream.character-encoding:CharEncoding

Current character encoding of bytes being read; defines how those bytes are being transcoded into characters.

Notes

This is not meaningful for some TextInputStreams that do not actually have underlying bytes.


Method Details