bool StdIOStreamInputStream::ReadImpl()

in source/io/Stream.cpp [108:125]


            bool StdIOStreamInputStream::ReadImpl(ByteBuf &buffer) noexcept
            {
                // so this blocks, but readsome() doesn't work at all, so this is the best we've got.
                // if you don't like this, don't use std::input_stream and implement your own version
                // of Aws::Crt::Io::InputStream.
                m_stream->read(reinterpret_cast<char *>(buffer.buffer + buffer.len), buffer.capacity - buffer.len);
                auto read = m_stream->gcount();
                buffer.len += static_cast<size_t>(read);

                if (read > 0 || (read == 0 && m_stream->eof()))
                {
                    return true;
                }

                auto status = GetStatusImpl();

                return status.is_valid && !status.is_end_of_stream;
            }