@{ @name Readable
| 144 | //@{ |
| 145 | // @name Readable |
| 146 | Result<int64_t> Read(int64_t nbytes, void* out) override { |
| 147 | if (closed()) return Status::Invalid("Cannot read from a closed stream"); |
| 148 | stream_.read(static_cast<char*>(out), nbytes); |
| 149 | ARROW_GCS_RETURN_NOT_OK(stream_.status()); |
| 150 | int64_t nread = stream_.gcount(); |
| 151 | nread_ += nread; |
| 152 | return nread; |
| 153 | } |
| 154 | |
| 155 | Result<std::shared_ptr<Buffer>> Read(int64_t nbytes) override { |
| 156 | if (closed()) return Status::Invalid("Cannot read from a closed stream"); |