Skip to content

Latest commit

 

History

History
61 lines (37 loc) · 1.18 KB

MemoryOutputStream.md

File metadata and controls

61 lines (37 loc) · 1.18 KB

MemoryOutputStream

template<typename Alloc>
class BasicMemoryOutputStream

Inherited from: OutputStream.

Required header: <Eclog/MemoryOutputStream.h>

The BasicMemoryOutputStream class is an in-memory OutputStream that writes bytes to an auto-growing byte buffer.

A typedef for the default allocator is provided:

typedef BasicMemoryOutputStream<ECLOG_DEFAULT_ALLOCATOR> MemoryOutputStream;

Template parameters

Alloc Allocator type used to allocate internal storage.

Member functions

Name Description
size Returns the number of bytes that have been written to the buffer.
data Returns a pointer to the first byte in the buffer.

size

size_t size() const;

Returns the number of bytes that have been written to the buffer.

Return value

size_t Number of bytes.


data

char* data();
const char* data() const;

Returns a pointer to the first byte in the buffer.

Return value

char* Pointer to the first byte.

const char* Pointer to the first byte.