class EpsCopyOutputStream

Defined at line 626 of file ../../third_party/protobuf/src/google/protobuf/io/coded_stream.h

EpsCopyOutputStream wraps a ZeroCopyOutputStream and exposes a new stream,

which has the property you can write kSlopBytes (16 bytes) from the current

position without bounds checks. The cursor into the stream is managed by

the user of the class and is an explicit parameter in the methods. Careful

use of this class, ie. keep ptr a local variable, eliminates the need to

for the compiler to sync the ptr value between register and memory.

Public Methods

void EnableAliasing (bool enabled)

Instructs the EpsCopyOutputStream to allow the underlying

ZeroCopyOutputStream to hold pointers to the original structure instead of

copying, if it supports it (i.e. output->AllowsAliasing() is true). If the

underlying stream does not support aliasing, then enabling it has no

affect. For now, this only affects the behavior of

WriteRawMaybeAliased().

NOTE: It is caller's responsibility to ensure that the chunk of memory

remains live until all of the data has been consumed from the stream.

void EpsCopyOutputStream (ZeroCopyOutputStream * stream, bool deterministic, uint8_t ** pp)

Initialize from a stream.

Defined at line 631 of file ../../third_party/protobuf/src/google/protobuf/io/coded_stream.h

void EpsCopyOutputStream (void * data, int size, bool deterministic)

Only for array serialization. No overflow protection, end_ will be the

pointed to the end of the array. When using this the total size is already

known, so no need to maintain the slop region.

Defined at line 642 of file ../../third_party/protobuf/src/google/protobuf/io/coded_stream.h

void EpsCopyOutputStream (void * data, int size, ZeroCopyOutputStream * stream, bool deterministic, uint8_t ** pp)

Initialize from stream but with the first buffer already given (eager).

Defined at line 649 of file ../../third_party/protobuf/src/google/protobuf/io/coded_stream.h

uint8_t * EnsureSpace (uint8_t * ptr)

After this it's guaranteed you can safely write kSlopBytes to ptr. This

will never fail! The underlying stream can produce an error. Use HadError

to check for errors.

Defined at line 662 of file ../../third_party/protobuf/src/google/protobuf/io/coded_stream.h

uint8_t * Trim (uint8_t * ptr)

Flush everything that's written into the underlying ZeroCopyOutputStream

and trims the underlying stream to the location of ptr.

uint8_t * WriteCord (const absl::Cord & cord, uint8_t * ptr)
int64_t ByteCount (uint8_t * ptr)

The number of bytes written to the stream at position ptr, relative to the

stream's overall position.

uint8_t * WriteRaw (const void * data, int size, uint8_t * ptr)

Defined at line 669 of file ../../third_party/protobuf/src/google/protobuf/io/coded_stream.h

uint8_t * WriteRawMaybeAliased (const void * data, int size, uint8_t * ptr)

Defined at line 683 of file ../../third_party/protobuf/src/google/protobuf/io/coded_stream.h

uint8_t * WriteStringMaybeAliased (uint32_t num, const std::string & s, uint8_t * ptr)

Defined at line 696 of file ../../third_party/protobuf/src/google/protobuf/io/coded_stream.h

uint8_t * WriteBytesMaybeAliased (uint32_t num, const std::string & s, uint8_t * ptr)

Defined at line 708 of file ../../third_party/protobuf/src/google/protobuf/io/coded_stream.h

template <typename T>
uint8_t * WriteString (uint32_t num, const T & s, uint8_t * ptr)

Defined at line 714 of file ../../third_party/protobuf/src/google/protobuf/io/coded_stream.h

uint8_t * WriteString (uint32_t num, const absl::Cord & s, uint8_t * ptr)

Defined at line 727 of file ../../third_party/protobuf/src/google/protobuf/io/coded_stream.h

template <typename T>
uint8_t * WriteBytes (uint32_t num, const T & s, uint8_t * ptr)

Defined at line 737 of file ../../third_party/protobuf/src/google/protobuf/io/coded_stream.h

template <typename T>
uint8_t * WriteInt32Packed (int num, const T & r, int size, uint8_t * ptr)

Defined at line 742 of file ../../third_party/protobuf/src/google/protobuf/io/coded_stream.h

template <typename T>
uint8_t * WriteUInt32Packed (int num, const T & r, int size, uint8_t * ptr)

Defined at line 747 of file ../../third_party/protobuf/src/google/protobuf/io/coded_stream.h

template <typename T>
uint8_t * WriteSInt32Packed (int num, const T & r, int size, uint8_t * ptr)

Defined at line 752 of file ../../third_party/protobuf/src/google/protobuf/io/coded_stream.h

template <typename T>
uint8_t * WriteInt64Packed (int num, const T & r, int size, uint8_t * ptr)

Defined at line 757 of file ../../third_party/protobuf/src/google/protobuf/io/coded_stream.h

template <typename T>
uint8_t * WriteUInt64Packed (int num, const T & r, int size, uint8_t * ptr)

Defined at line 762 of file ../../third_party/protobuf/src/google/protobuf/io/coded_stream.h

template <typename T>
uint8_t * WriteSInt64Packed (int num, const T & r, int size, uint8_t * ptr)

Defined at line 767 of file ../../third_party/protobuf/src/google/protobuf/io/coded_stream.h

template <typename T>
uint8_t * WriteEnumPacked (int num, const T & r, int size, uint8_t * ptr)

Defined at line 772 of file ../../third_party/protobuf/src/google/protobuf/io/coded_stream.h

template <typename T>
uint8_t * WriteFixedPacked (int num, const T & r, uint8_t * ptr)

Defined at line 778 of file ../../third_party/protobuf/src/google/protobuf/io/coded_stream.h

bool HadError ()

Returns true if there was an underlying I/O error since this object was

created.

Defined at line 790 of file ../../third_party/protobuf/src/google/protobuf/io/coded_stream.h

void SetSerializationDeterministic (bool value)

See documentation on CodedOutputStream::SetSerializationDeterministic.

Defined at line 804 of file ../../third_party/protobuf/src/google/protobuf/io/coded_stream.h

bool IsSerializationDeterministic ()

See documentation on CodedOutputStream::IsSerializationDeterministic.

Defined at line 809 of file ../../third_party/protobuf/src/google/protobuf/io/coded_stream.h

uint8_t * SetInitialBuffer (void * data, int size)

These methods are for CodedOutputStream. Ideally they should be private

but to match current behavior of CodedOutputStream as close as possible

we allow it some functionality.

Defined at line 933 of file ../../third_party/protobuf/src/google/protobuf/io/coded_stream.h

Enumerations

enum 
Name Value
kSlopBytes 16

Defined at line 628 of file ../../third_party/protobuf/src/google/protobuf/io/coded_stream.h

Friends

class CodedOutputStream