the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
1#pragma once
2
3#include "OutputStream.h"
4
5class ByteArrayOutputStream : public OutputStream
6{
7// Note - when actually implementing, byteArray will need to grow as data is written
8public:
9 byteArray buf; //The buffer where data is stored.
10
11protected:
12 unsigned int count; //The number of valid bytes in the buffer.
13
14public:
15 ByteArrayOutputStream();
16 ByteArrayOutputStream(unsigned int size);
17 virtual ~ByteArrayOutputStream();
18
19 virtual void flush() {}
20 virtual void write(unsigned int b);
21 virtual void write(byteArray b);
22 virtual void write(byteArray b, unsigned int offset, unsigned int length);
23 virtual void close();
24 virtual byteArray toByteArray();
25
26 void reset() { count = 0; }
27 unsigned int size() { return count; }
28
29};