class Readable<TSelf>
package js.node.stream
extends Stream › EventEmitter
extended by ReadStream, IncomingMessage, Duplex
Static methods
Constructor
Variables
read onlyisTTY:Bool
Terminal read streams (i.e. process.stdin) have this property set to true. It is false for any other read streams.
See also:
read onlyreadableEncoding:Null<String>
Getter for the property encoding
of a given Readable
stream.
The encoding
property can be set using the readable.setEncoding()
method.
See also:
read onlyreadableHighWaterMark:Int
read onlyreadableLength:Int
This property contains the number of bytes (or objects) in the queue ready to be read.
The value provides introspection data regarding the status of the highWaterMark
.
See also:
read onlyreadableObjectMode:Bool
Methods
destroy(?error:Error):TSelf
Destroy the stream. Optionally emit an 'error'
event, and emit a 'close'
event unless emitClose
is set in false
.
After this call, the readable stream will release any internal resources and subsequent calls to push()
will be ignored.
Implementors should not override this method, but instead implement readable._destroy()
.
See also:
isPaused():Bool
The readable.isPaused()
method returns the current operating state of the Readable
.
This is used primarily by the mechanism that underlies the readable.pipe()
method.
In most typical cases, there will be no reason to use this method directly.
See also:
pause():TSelf
The readable.pause()
method will cause a stream in flowing mode to stop emitting 'data'
events,
switching out of flowing mode. Any data that becomes available will remain in the internal buffer.
See also:
pipe<T>(destination:T, ?options:{end:Null<Bool>}):T
The readable.pipe()
method attaches a Writable
stream to the readable
,
causing it to switch automatically into flowing mode and push all of its data to the attached Writable
.
The flow of data will be automatically managed so that the destination Writable
stream
is not overwhelmed by a faster Readable
stream.
See also:
read(?size:Int):Null<Dynamic>
The readable.read()
method pulls some data out of the internal buffer and returns it.
If no data available to be read, null
is returned. By default,
the data will be returned as a Buffer
object unless an encoding has been specified using
the readable.setEncoding()
method or the stream is operating in object mode.
See also:
resume():TSelf
The readable.resume()
method causes an explicitly paused Readable
stream to resume emitting 'data'
events,
switching the stream into flowing mode.
See also:
setEncoding(encoding:String):TSelf
The readable.setEncoding()
method sets the character encoding for data read from the Readable
stream.
See also:
unpipe(?destination:IWritable):TSelf
The readable.unpipe()
method detaches a Writable
stream previously attached using the stream.pipe()
method.
See also:
unshift(chunk:Null<Dynamic>, ?encoding:String):Void
Passing chunk
as null
signals the end of the stream (EOF), after which no more data can be written.
See also: