From 7dc6009fc09261df10ae7e357e696041e8d1da13 Mon Sep 17 00:00:00 2001 From: izzy Date: Sat, 7 Mar 2026 21:28:09 -0500 Subject: [PATCH] fix: restore charArray version of `readFully` --- Minecraft.World/DataInputStream.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Minecraft.World/DataInputStream.cpp b/Minecraft.World/DataInputStream.cpp index a24f533be..444e50443 100644 --- a/Minecraft.World/DataInputStream.cpp +++ b/Minecraft.World/DataInputStream.cpp @@ -182,6 +182,20 @@ bool DataInputStream::readFully(byteArray b) return true; } +bool DataInputStream::readFully(charArray b) +{ + for (unsigned int i = 0; i < b.length; i++) + { + int byteRead = stream->read(); + if (byteRead == -1) + { + throw EOFException(L"DataInputStream::readFully - end of stream"); + } + b[i] = byteRead; + } + return true; +} + //Reads eight input bytes and returns a double value. It does this by first constructing a long value in exactly the manner //of the readlong method, then converting this long value to a double in exactly the manner of the method Double.longBitsToDouble. //This method is suitable for reading bytes written by the writeDouble method of interface DataOutput.