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)