diff --git a/include/aws/crt/io/Stream.h b/include/aws/crt/io/Stream.h index 929ecba9c..b41f36413 100644 --- a/include/aws/crt/io/Stream.h +++ b/include/aws/crt/io/Stream.h @@ -156,7 +156,7 @@ namespace Aws * * @return return value of the underlying istream::peek */ - virtual uint8_t PeekImpl() const noexcept = 0; + virtual int64_t PeekImpl() const noexcept = 0; private: static int s_Seek(aws_input_stream *stream, int64_t offset, enum aws_stream_seek_basis basis); @@ -187,7 +187,7 @@ namespace Aws StreamStatus GetStatusImpl() const noexcept override; int64_t GetLengthImpl() const noexcept override; bool SeekImpl(OffsetType offsetType, StreamSeekBasis seekBasis) noexcept override; - uint8_t PeekImpl() const noexcept override; + int64_t PeekImpl() const noexcept override; private: std::shared_ptr m_stream; diff --git a/source/io/Stream.cpp b/source/io/Stream.cpp index 9bf8384d6..b16267f10 100644 --- a/source/io/Stream.cpp +++ b/source/io/Stream.cpp @@ -156,8 +156,7 @@ namespace Aws // I have no idea why "readsome() doesn't work at all" for the original dev. It works well for me // Jokes aside, read will always block and try to read till eof // readsome will return available bytes without waiting for eof and without closing the stream. - auto actuallyRead = 0; - actuallyRead = m_stream->readsome( + auto actuallyRead = m_stream->readsome( reinterpret_cast(buffer.buffer + buffer.len), buffer.capacity - buffer.len); buffer.len += static_cast(actuallyRead); @@ -229,7 +228,7 @@ namespace Aws return true; } - uint8_t StdIOStreamInputStream::PeekImpl() const noexcept + int64_t StdIOStreamInputStream::PeekImpl() const noexcept { return m_stream->peek(); }