TU19: merge Minecraft.World/IO

This commit is contained in:
MatthewBeshay
2026-03-22 10:05:26 +11:00
parent 11a0440998
commit 993617025b
8 changed files with 76 additions and 47 deletions

View File

@@ -323,6 +323,17 @@ short DataInputStream::readShort() {
return (short)((a << 8) | (b & 0xff));
}
unsigned short DataInputStream::readUnsignedShort() {
if (stream == NULL) {
app.DebugPrintf(
"DataInputStream::readUnsignedShort() but underlying stream is NULL\n");
return 0;
}
int a = stream->read();
int b = stream->read();
return static_cast<unsigned short>(((a & 0xff) << 8) | (b & 0xff));
}
// Reads in a string that has been encoded using a modified UTF-8 format. The
// general contract of readUTF is that it reads a representation of a Unicode
// character string encoded in modified UTF-8 format; this string of characters