class WritableBinaryStream

Declaration

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

Description

A BinaryStream which can be read from as well as written to. Note that writing to a BinaryStream always necessitates copying from the input buffer to the stream's backing store. Streams are assumed to be buffered so that to be portable it is necessary to call commit() on the stream when all data has been written.

Declared at: llvm/include/llvm/Support/BinaryStream.h:73

Inherits from: BinaryStream

Method Overview

Inherited from BinaryStream:

Methods

llvm::Error checkOffsetForWrite(uint64_t Offset,
                                uint64_t DataSize)

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

Parameters

uint64_t Offset
uint64_t DataSize

virtual llvm::Error commit()

Description

For buffered streams, commits changes to the backing store.

Declared at: llvm/include/llvm/Support/BinaryStream.h:83

llvm::BinaryStreamFlags getFlags() const

Description

Return the properties of this stream.

Declared at: llvm/include/llvm/Support/BinaryStream.h:86

virtual llvm::Error writeBytes(
    uint64_t Offset,
    ArrayRef<uint8_t> Data)

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/BinaryStream.h:80

Parameters

uint64_t Offset
ArrayRef<uint8_t> Data

~WritableBinaryStream()

Declared at: llvm/include/llvm/Support/BinaryStream.h:75