#include <GStream.h>
Public Member Functions | |
GMemStream () | |
Builds an empty memory stream. | |
GMemStream (GStreamI *Src, int64 Start, int64 Len) | |
Builds memory from sub-stream. | |
GMemStream (void *Mem, int64 Len, bool Copy=true) | |
Builds a memory stream by copying from another memory block. | |
GMemStream (int GrowBlockSize) | |
Growable array to write to. | |
bool | IsOpen () |
Returns true is the stream is still open. | |
int | Close () |
int64 | GetSize () |
Gets the size of the stream. | |
int64 | GetPos () |
Gets the current position of the stream. | |
int64 | SetPos (int64 p) |
Sets the current position of the stream. | |
int | Open (const char *Str, int Int) |
Opens a file and reads it all into memory. | |
int64 | SetSize (int64 Size) |
Changes the size of the memory block, keeping any common bytes. | |
int | Read (void *Buffer, int Size, int Flags=0) |
Read bytes out of the stream. | |
int | Write (const void *Buffer, int Size, int Flags=0) |
Write bytes to the stream. | |
GStreamI * | Clone () |
Creates a dynamically allocated copy of the same type of stream. This new stream is not connected to anything. |
Builds memory from sub-stream.
Src | The source stream |
Start | The starting position in the stream, or -1 for the current position. Use -1 for non-seekable streams like sockets |
Len | The length of the sub-stream, or -1 to read all the data to the end |
References GBytePipe::GetSize(), GStreamI::GetSize(), GetSize(), GBytePipe::New(), GStreamI::Read(), GStreamI::SetPos(), and GBytePipe::Write().
GMemStream::GMemStream | ( | void * | Mem, | |
int64 | Len, | |||
bool | Copy = true | |||
) |
Builds a memory stream by copying from another memory block.
Mem | The source memory block |
Len | The length of the block |
Copy | Whether to copy the block or reference memory we don't own |
int GMemStream::Close | ( | ) | [virtual] |
int64 GMemStream::GetSize | ( | ) | [inline, virtual] |
Gets the size of the stream.
Reimplemented from GStreamI.
Referenced by GMemStream(), and GTempStream::Write().
int64 GMemStream::GetPos | ( | ) | [inline, virtual] |
Gets the current position of the stream.
Reimplemented from GStreamI.
Sets the current position of the stream.
Reimplemented from GStreamI.
Referenced by GTempStream::Write().
int GMemStream::Read | ( | void * | Buffer, | |
int | Size, | |||
int | Flags = 0 | |||
) | [virtual] |
Read bytes out of the stream.
Reimplemented from GStream.
int GMemStream::Write | ( | const void * | Buffer, | |
int | Size, | |||
int | Flags = 0 | |||
) | [virtual] |
Write bytes to the stream.
Reimplemented from GStream.
Referenced by GTempStream::Write().
GStreamI * GMemStream::Clone | ( | ) | [virtual] |
Creates a dynamically allocated copy of the same type of stream. This new stream is not connected to anything.
Reimplemented from GStreamI.
References GMemStream().