mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-08-14 02:27:21 -07:00
git subrepo clone https://github.com/HarbourMasters/ZAPDTR.git
subrepo: subdir: "ZAPDTR" merged: "a53a53ea4" upstream: origin: "https://github.com/HarbourMasters/ZAPDTR.git" branch: "master" commit: "a53a53ea4" git-subrepo: version: "0.4.1" origin: "???" commit: "???"
This commit is contained in:
parent
f52a2a6406
commit
5dda5762ba
217 changed files with 47152 additions and 0 deletions
33
ZAPDTR/ZAPDUtils/Utils/MemoryStream.h
Normal file
33
ZAPDTR/ZAPDUtils/Utils/MemoryStream.h
Normal file
|
@ -0,0 +1,33 @@
|
|||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
#include "Stream.h"
|
||||
|
||||
class MemoryStream : public Stream
|
||||
{
|
||||
public:
|
||||
MemoryStream();
|
||||
MemoryStream(char* nBuffer, size_t nBufferSize);
|
||||
~MemoryStream();
|
||||
|
||||
uint64_t GetLength() override;
|
||||
|
||||
void Seek(int32_t offset, SeekOffsetType seekType) override;
|
||||
|
||||
std::unique_ptr<char[]> Read(size_t length) override;
|
||||
void Read(const char* dest, size_t length) override;
|
||||
int8_t ReadByte() override;
|
||||
|
||||
void Write(char* srcBuffer, size_t length) override;
|
||||
void WriteByte(int8_t value) override;
|
||||
|
||||
std::vector<char> ToVector();
|
||||
|
||||
void Flush() override;
|
||||
void Close() override;
|
||||
|
||||
protected:
|
||||
std::vector<char> buffer;
|
||||
std::size_t bufferSize;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue