Something went wrong. Try again.
the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
Something went wrong. Try again.
730 B · 29 lines
C
at main
1234567891011121314151617181920212223242526272829#pragma once
#include "OutputStream.h"
class ByteArrayOutputStream : public OutputStream{// Note - when actually implementing, byteArray will need to grow as data is writtenpublic: 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; } };