aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World/ByteArrayInputStream.h
diff options
context:
space:
mode:
authordaoge_cmd <3523206925@qq.com>2026-03-01 12:16:08 +0800
committerdaoge_cmd <3523206925@qq.com>2026-03-01 12:16:08 +0800
commitb691c43c44ff180d10e7d4a9afc83b98551ff586 (patch)
tree3e9849222cbc6ba49f2f1fc6e5fe7179632c7390 /Minecraft.World/ByteArrayInputStream.h
parentdef8cb415354ac390b7e89052a50605285f1aca9 (diff)
Initial commit
Diffstat (limited to 'Minecraft.World/ByteArrayInputStream.h')
-rw-r--r--Minecraft.World/ByteArrayInputStream.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/Minecraft.World/ByteArrayInputStream.h b/Minecraft.World/ByteArrayInputStream.h
new file mode 100644
index 00000000..e74b1cf7
--- /dev/null
+++ b/Minecraft.World/ByteArrayInputStream.h
@@ -0,0 +1,26 @@
+#pragma once
+// 4J Stu - Represents Java standard library class
+
+#include "InputStream.h"
+
+class ByteArrayInputStream : public InputStream
+{
+protected:
+ byteArray buf; //An array of bytes that was provided by the creator of the stream.
+ unsigned int count; //The index one greater than the last valid character in the input stream buffer.
+ unsigned int mark; //The currently marked position in the stream.
+ unsigned int pos; //The index of the next character to read from the input stream buffer.
+
+public:
+ ByteArrayInputStream(byteArray buf, unsigned int offset, unsigned int length);
+ ByteArrayInputStream(byteArray buf);
+ virtual ~ByteArrayInputStream();
+ virtual int read();
+ virtual int read(byteArray b);
+ virtual int read(byteArray b, unsigned int offset, unsigned int length);
+ virtual void close();
+ virtual __int64 skip(__int64 n);
+
+ // 4J Stu Added - Sometimes we don't want to delete the data on destroying this
+ void reset() { buf = byteArray(); count = 0; mark = 0; pos = 0; }
+}; \ No newline at end of file