Stream

A stream

Members

Functions

close
void close()

Closes the stream

flush
void flush()

Flushes and syncronizes the stream

peek
int peek(ubyte[] data)

Peek the X amount of bytes from the current position

read
int read(ubyte[] buffer)

Reads the specified amount out to the buffer

read
int read(size_t amount, ubyte[] buffer)

Reads the specified amount out to the buffer

rewind
void rewind()

Seeks back to start of stream

seek
void seek(long position, StreamOrigin origin)

Seek to a specified position in the stream

tell
ulong tell()

Returns the position of the stream the cursor is at

write
void write(ubyte[] buffer)

Writes the buffer to the stream

write
void write(ubyte[] buffer, size_t start)

Writes the buffer to the stream from the start position

write
void write(ubyte[] buffer, size_t start, size_t length)

Writes the buffer to the stream from the start position to the specified length

Properties

canRead
bool canRead [@property getter]

Gets wether the stream can be read from

canSeek
bool canSeek [@property getter]

Gets wether the stream is seekable

canTell
bool canTell [@property getter]

Gets wether the stream is tellable

canWrite
bool canWrite [@property getter]

Gets wether the stream can be written to

eof
bool eof [@property getter]

Gets wether the end has been reached

knowsLength
bool knowsLength [@property getter]

Gets wether the stream knows its length

length
size_t length [@property getter]

Gets the length of the stream (if possible)

position
size_t position [@property getter]

Gets the position of the stream

Meta