MemoryDevice

Simulates a device that you can write to and read from, behaves pretty much like a file

Members

Functions

bufferSize
size_t bufferSize()
close
void close()

Deletes the buffer and resets position

conduit
IConduit conduit()

Used by FormatOutput and other streams.

copy
OutputStream copy(InputStream src, size_t max)

Copies src into this stream, overwriting any existing data

detach
void detach()

Implemented because interfaces demand it, does nothing

error
void error(istring msg)

Throws an exception

flush
IOStream flush()

Does nothing

input
InputStream input()
isAlive
bool isAlive()

Implemented because interfaces demand it, returns always true

load
void[] load(size_t max)
output
OutputStream output()
peek
const(void)[] peek()
read
size_t read(void[] dst)

Reads into dst, starting to read from the current seek position

seek
long seek(long offset, Anchor anchor)

Change the internal seeker position

toString
istring toString()
write
size_t write(const(void)[] src)

Write into this device, starting at the current seek position

Inherited Members

From IConduit

bufferSize
size_t bufferSize()

Return a preferred size for buffering conduit I/O.

toString
istring toString()

Return the name of this conduit.

isAlive
bool isAlive()

Is the conduit alive?

detach
void detach()

Release external resources.

error
void error(istring msg)

Throw a generic IO exception with the provided msg.

Seek
interface Seek

All streams now support seek(), so this is used to signal a seekable conduit instead.

Truncate
interface Truncate

Indicates the conduit supports resize/truncation.

Meta