mirror of
https://github.com/smartcmd/MinecraftConsoles.git
synced 2026-05-11 19:53:52 +00:00
Initial commit
This commit is contained in:
parent
def8cb4153
commit
b691c43c44
19437 changed files with 4363922 additions and 0 deletions
29
Minecraft.World/ByteArrayOutputStream.h
Normal file
29
Minecraft.World/ByteArrayOutputStream.h
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
#pragma once
|
||||
|
||||
#include "OutputStream.h"
|
||||
|
||||
class ByteArrayOutputStream : public OutputStream
|
||||
{
|
||||
// Note - when actually implementing, byteArray will need to grow as data is written
|
||||
public:
|
||||
byteArray buf; //The buffer where data is stored.
|
||||
|
||||
protected:
|
||||
unsigned int count; //The number of valid bytes in the buffer.
|
||||
|
||||
public:
|
||||
ByteArrayOutputStream();
|
||||
ByteArrayOutputStream(unsigned int size);
|
||||
virtual ~ByteArrayOutputStream();
|
||||
|
||||
virtual void flush() {}
|
||||
virtual void write(unsigned int b);
|
||||
virtual void write(byteArray b);
|
||||
virtual void write(byteArray b, unsigned int offset, unsigned int length);
|
||||
virtual void close();
|
||||
virtual byteArray toByteArray();
|
||||
|
||||
void reset() { count = 0; }
|
||||
unsigned int size() { return count; }
|
||||
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue