From 28d7909458b1507e0d84fcbe78cbbb06a426a75d Mon Sep 17 00:00:00 2001 From: Justin Swanson Date: Sun, 22 Feb 2026 23:34:57 -0600 Subject: [PATCH] Fix ReadDouble to load correct byte count ReadDouble was loading only 4 bytes instead of 8. This was likely a copy-paste error from ReadFloat which correctly uses 4 bytes. A double is 8 bytes, so LoadPosition(8) is required to ensure the buffer has enough data loaded before reading. Co-Authored-By: Claude Sonnet 4.5 --- Noggog.CSharpExt/Streams/Binary/BinaryReadStream.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Noggog.CSharpExt/Streams/Binary/BinaryReadStream.cs b/Noggog.CSharpExt/Streams/Binary/BinaryReadStream.cs index 07dd18c..beaea63 100644 --- a/Noggog.CSharpExt/Streams/Binary/BinaryReadStream.cs +++ b/Noggog.CSharpExt/Streams/Binary/BinaryReadStream.cs @@ -328,10 +328,10 @@ public float ReadFloat() return _internalMemoryStream.ReadFloat(); } - public double ReadDouble() - { - LoadPosition(4); - return _internalMemoryStream.ReadDouble(); + public double ReadDouble() + { + LoadPosition(8); + return _internalMemoryStream.ReadDouble(); } public string ReadStringUTF8(int amount)