10 #ifndef LLVM_SUPPORT_BINARYSTREAM_H
11 #define LLVM_SUPPORT_BINARYSTREAM_H
78 #endif // LLVM_SUPPORT_BINARYSTREAM_H
Error checkOffset(uint32_t Offset, uint32_t DataSize)
virtual Error readBytes(uint32_t Offset, uint32_t Size, ArrayRef< uint8_t > &Buffer)=0
Given an offset into the stream and a number of bytes, attempt to read the bytes and set the output A...
virtual ~BinaryStream()=default
virtual uint32_t getLength()=0
Return the number of bytes of data in this stream.
virtual Error writeBytes(uint32_t Offset, ArrayRef< uint8_t > Data)=0
Attempt to write the given bytes into the stream at the desired offset.
virtual llvm::support::endianness getEndian() const =0
virtual Error readLongestContiguousChunk(uint32_t Offset, ArrayRef< uint8_t > &Buffer)=0
Given an offset into the stream, read as much as possible without copying any data.
An interface for accessing data in a stream-like format, but which discourages copying.
static ErrorSuccess success()
Create a success value.
constexpr char Size[]
Key for Kernel::Arg::Metadata::mSize.
virtual Error commit()=0
For buffered streams, commits changes to the backing store.
Lightweight error class with error context and mandatory checking.
~WritableBinaryStream() override=default
A BinaryStream which can be read from as well as written to.