class

TermBuf::Meter

Inherits IO < Reference < Object

Stability: internal

Counts the bytes going to the terminal on their way past.

Wrapping rather than buffering keeps the write path one pass: the encoder still writes straight through to the device, and the count is a single addition per write.

Constructors

new(io : IO)
Source

Instance methods

bytes

Bytes since this was last set to zero.

Source
bytes=(bytes : Int32)

Bytes since this was last set to zero.

Source
flush

Flushes the stream underneath.

Source
read(slice : Bytes) : Int32

Always raises. A meter sits on the way out only.

Source
write(slice : Bytes) : Nil

Counts slice and passes it on.

Source