class MutableBinaryByteStream

Declaration

class MutableBinaryByteStream : public WritableBinaryStream { /* full declaration omitted */ };

Description

An implementation of BinaryStream which holds its entire data set in a single contiguous buffer. As with BinaryByteStream, the mutable version also guarantees that no read operation will ever incur a copy, and similarly it does not own the underlying buffer.

Declared at: llvm/include/llvm/Support/BinaryByteStream.h:89

Inherits from: WritableBinaryStream

Method Overview

Inherited from WritableBinaryStream:

Inherited from BinaryStream:

Methods

MutableBinaryByteStream()

Declared at: llvm/include/llvm/Support/BinaryByteStream.h:91

MutableBinaryByteStream(
    MutableArrayRef<uint8_t> Data,
    llvm::support::endianness Endian)

Declared at: llvm/include/llvm/Support/BinaryByteStream.h:92

Parameters

MutableArrayRef<uint8_t> Data
llvm::support::endianness Endian

llvm::Error commit()

Description

For buffered streams, commits changes to the backing store.

Declared at: llvm/include/llvm/Support/BinaryByteStream.h:124

MutableArrayRef<uint8_t> data() const

Declared at: llvm/include/llvm/Support/BinaryByteStream.h:126

llvm::support::endianness getEndian() const

Declared at: llvm/include/llvm/Support/BinaryByteStream.h:96

uint32_t getLength()

Description

Return the number of bytes of data in this stream.

Declared at: llvm/include/llvm/Support/BinaryByteStream.h:110

llvm::Error readBytes(uint32_t Offset,
                      uint32_t Size,
                      ArrayRef<uint8_t>& Buffer)

Description

Given an offset into the stream and a number of bytes, attempt to read the bytes and set the output ArrayRef to point to data owned by the stream.

Declared at: llvm/include/llvm/Support/BinaryByteStream.h:100

Parameters

uint32_t Offset
uint32_t Size
ArrayRef<uint8_t>& Buffer

llvm::Error readLongestContiguousChunk(
    uint32_t Offset,
    ArrayRef<uint8_t>& Buffer)

Description

Given an offset into the stream, read as much as possible without copying any data.

Declared at: llvm/include/llvm/Support/BinaryByteStream.h:105

Parameters

uint32_t Offset
ArrayRef<uint8_t>& Buffer

llvm::Error writeBytes(uint32_t Offset,
                       ArrayRef<uint8_t> Buffer)

Description

Attempt to write the given bytes into the stream at the desired offset. This will always necessitate a copy. Cannot shrink or grow the stream, only writes into existing allocated space.

Declared at: llvm/include/llvm/Support/BinaryByteStream.h:112

Parameters

uint32_t Offset
ArrayRef<uint8_t> Buffer