vibe.d beta banner
get vibe.d
0.10.1

Asynchronous I/O that doesn’t get in your way, written in D

Struct BufferedStream

Random access stream that provides buffering on top of a wrapped stream.

struct BufferedStream(S) ;

The source stream is logically split up into chunks of equal size, where a defined maximum number of those chunks can be cached in memory. Cached chunks are managed using a LRU strategy.

Constructors

NameDescription
this (stream, buffer_size, buffer_count)

Fields

NameTypeDescription
m_state BufferedStream.State*

Properties

NameTypeDescription
dataAvailableForRead[get] bool
empty[get] bool
isOpen[get] bool
leastSize[get] ulong
readable[get] bool
size[get] ulong
underlying[get] inout(S)
writable[get] bool

Methods

NameDescription
close ()
finalize ()
flush ()
peek ()
read (dst, mode)
read (dst)
seek (offset)
state ()
sync () Flushes and releases all buffers and updates the buffer size.
tell ()
truncate (size)
write (bytes, mode)
write (bytes)
write (bytes)

Inner structs

NameDescription
State
Authors

Sönke Ludwig

Copyright

© 2020-2021 Sönke Ludwig

License

Subject to the terms of the MIT license, as written in the included LICENSE.txt file.