wavelength 1.0.0
Loading...
Searching...
No Matches
BufStream.h
Go to the documentation of this file.
1#pragma once
2
3#include "utl/BinStream.h"
4
11class BufStream : public BinStream {
12public:
21 BufStream(char *buffer, int size, bool littleEndian);
22
28 virtual ~BufStream();
29
37 virtual void Read(void *data, int bytes);
38
46 virtual void Write(const void *data, int bytes);
47
49 virtual void Flush() {
50 }
51
59 virtual void Seek(int offset, SeekType type);
60
65 virtual int Tell();
66
71 virtual bool Eof();
72
77 virtual bool Fail();
78
79private:
80 char *mBuffer;
81 bool mFail;
82 int mTell;
83 int mSize;
84};
Stream of raw bytes, the base of the memory, file, and network streams.
Definition binstream.h:22
SeekType
Origins of Seek().
Definition binstream.h:25
BinStream over a buffer the caller provides.
Definition bufstream.h:12
virtual void Read(void *data, int bytes)
Copy bytes out of the buffer.
virtual void Flush()
Do nothing; the buffer holds every byte written.
Definition BufStream.h:49
virtual ~BufStream()
Destroy the stream.
virtual int Tell()
virtual void Seek(int offset, SeekType type)
Move the position, failing the stream when it would leave the buffer.
virtual void Write(const void *data, int bytes)
Copy bytes into the buffer.
virtual bool Eof()
virtual bool Fail()
BufStream(char *buffer, int size, bool littleEndian)
Start a stream at the beginning of a buffer.