From d628c6b5c341cb7d49089e7af1a06f0939fb3eaf Mon Sep 17 00:00:00 2001 From: Danilo Borges Santos Date: Thu, 12 Dec 2024 09:28:40 -0300 Subject: [PATCH] Remove ReadChar8 --- includes/csharp/io/binary.hpp | 3 +-- sources/csharp/io/binary.cpp | 17 +++-------------- 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/includes/csharp/io/binary.hpp b/includes/csharp/io/binary.hpp index 86bc5fc..f3ffd87 100644 --- a/includes/csharp/io/binary.hpp +++ b/includes/csharp/io/binary.hpp @@ -57,8 +57,7 @@ namespace csharp { return InternalReadByte() != 0; } - virtual char ReadChar(); - virtual char ReadChar8(); + virtual char ReadChar(bool twoBytesPerChar = false); virtual int16_t ReadInt16() { return ReadNumeric(); diff --git a/sources/csharp/io/binary.cpp b/sources/csharp/io/binary.cpp index 81fc225..1e4f1d9 100644 --- a/sources/csharp/io/binary.cpp +++ b/sources/csharp/io/binary.cpp @@ -82,8 +82,8 @@ namespace csharp { return static_cast(b); } - char BinaryReader::ReadChar() { - const auto value = Read(); + char BinaryReader::ReadChar(bool twoBytes = false) { + const auto value = Read(twoBytes); if (value == -1) { @@ -91,18 +91,7 @@ namespace csharp { } return static_cast(value); - } - - char BinaryReader::ReadChar8() { - const auto value = Read(true); - - if (value == -1) - { - throw EndOfStreamException(SR::IO_EOF_ReadBeyondEOF); - } - - return static_cast(value); - } + } void BinaryReader::InternalRead(std::vector& buffer) { if (_disposed)