Property | Type | Description | |
---|---|---|---|
DefaultBufferSize | int |
Method | Description | |
---|---|---|
CheckNoSpaceLeft ( ) : void |
Verifies that SpaceLeft returns zero. It's common to create a byte array that is exactly big enough to hold a message, then write to it with a CodedOutputStream. Calling CheckNoSpaceLeft after writing verifies that the message was actually as big as expected, which can help bugs.
|
|
CodedOutputStream ( Stream output ) : System |
Creates a new CodedOutputStream which write to the given stream, and disposes of that stream when the returned
|
|
CodedOutputStream ( Stream output, bool leaveOpen ) : System |
Creates a new CodedOutputStream which write to the given stream.
|
|
CodedOutputStream ( Stream output, int bufferSize ) : System |
Creates a new CodedOutputStream which write to the given stream and uses the specified buffer size.
|
|
CodedOutputStream ( Stream output, int bufferSize, bool leaveOpen ) : System |
Creates a new CodedOutputStream which write to the given stream and uses the specified buffer size.
|
|
CodedOutputStream ( byte flatArray ) : System |
Creates a new CodedOutputStream that writes directly to the given byte array. If more bytes are written than fit in the array, OutOfSpaceException will be thrown.
|
|
Dispose ( ) : void |
Flushes any buffered data and optionally closes the underlying stream, if any. By default, any underlying stream is closed by this method. To configure this behaviour, use a constructor overload with a For the sake of efficiency, calling this method does not prevent future write calls - but if a later write ends up writing to a stream which has been disposed, that is likely to fail. It is recommend that you not call any other methods after this. |
|
Flush ( ) : void |
Flushes any buffered data to the underlying stream (if there is one).
|
|
WriteBool ( bool value ) : void |
Writes a bool field value, without a tag, to the stream.
|
|
WriteBytes ( ByteString value ) : void |
Write a byte string, without a tag, to the stream. The data is length-prefixed.
|
|
WriteDouble ( double value ) : void |
Writes a double field value, without a tag, to the stream.
|
|
WriteEnum ( int value ) : void |
Writes an enum value, without a tag, to the stream.
|
|
WriteFixed32 ( uint value ) : void |
Writes a fixed32 field value, without a tag, to the stream.
|
|
WriteFixed64 ( ulong value ) : void |
Writes a fixed64 field value, without a tag, to the stream.
|
|
WriteFloat ( float value ) : void |
Writes a float field value, without a tag, to the stream.
|
|
WriteInt32 ( int value ) : void |
Writes an int32 field value, without a tag, to the stream.
|
|
WriteInt64 ( long value ) : void |
Writes an int64 field value, without a tag, to the stream.
|
|
WriteLength ( int length ) : void |
Writes a length (in bytes) for length-delimited data. This method simply writes a rawint, but exists for clarity in calling code. |
|
WriteMessage ( IMessage value ) : void |
Writes a message, without a tag, to the stream. The data is length-prefixed.
|
|
WriteRawTag ( byte b1 ) : void |
Writes the given single-byte tag directly to the stream.
|
|
WriteRawTag ( byte b1, byte b2 ) : void |
Writes the given two-byte tag directly to the stream.
|
|
WriteRawTag ( byte b1, byte b2, byte b3 ) : void |
Writes the given three-byte tag directly to the stream.
|
|
WriteRawTag ( byte b1, byte b2, byte b3, byte b4 ) : void |
Writes the given four-byte tag directly to the stream.
|
|
WriteRawTag ( byte b1, byte b2, byte b3, byte b4, byte b5 ) : void |
Writes the given five-byte tag directly to the stream.
|
|
WriteSFixed32 ( int value ) : void |
Writes an sfixed32 value, without a tag, to the stream.
|
|
WriteSFixed64 ( long value ) : void |
Writes an sfixed64 value, without a tag, to the stream.
|
|
WriteSInt32 ( int value ) : void |
Writes an sint32 value, without a tag, to the stream.
|
|
WriteSInt64 ( long value ) : void |
Writes an sint64 value, without a tag, to the stream.
|
|
WriteString ( string value ) : void |
Writes a string field value, without a tag, to the stream. The data is length-prefixed.
|
|
WriteTag ( int fieldNumber, WireFormat type ) : void |
Encodes and writes a tag.
|
|
WriteTag ( uint tag ) : void |
Writes an already-encoded tag.
|
|
WriteUInt32 ( uint value ) : void |
Writes a uint32 value, without a tag, to the stream.
|
|
WriteUInt64 ( ulong value ) : void |
Writes a uint64 field value, without a tag, to the stream.
|
Method | Description | |
---|---|---|
CodedOutputStream ( Stream output, byte buffer, bool leaveOpen ) : System | ||
CodedOutputStream ( byte buffer, int offset, int length ) : System |
Creates a new CodedOutputStream that writes directly to the given byte array slice. If more bytes are written than fit in the array, OutOfSpaceException will be thrown.
|
|
EncodeZigZag32 ( int n ) : uint |
Encode a 32-bit value with ZigZag encoding. ZigZag encodes signed integers into values that can be efficiently encoded with varint. (Otherwise, negative values must be sign-extended to 64 bits to be varint encoded, thus always taking 10 bytes on the wire.) |
|
EncodeZigZag64 ( long n ) : ulong |
Encode a 64-bit value with ZigZag encoding. ZigZag encodes signed integers into values that can be efficiently encoded with varint. (Otherwise, negative values must be sign-extended to 64 bits to be varint encoded, thus always taking 10 bytes on the wire.) |
|
RefreshBuffer ( ) : void | ||
WriteRawByte ( byte value ) : void | ||
WriteRawByte ( uint value ) : void | ||
WriteRawBytes ( byte value ) : void |
Writes out an array of bytes.
|
|
WriteRawBytes ( byte value, int offset, int length ) : void |
Writes out part of an array of bytes.
|
|
WriteRawLittleEndian32 ( uint value ) : void | ||
WriteRawLittleEndian64 ( ulong value ) : void | ||
WriteRawVarint32 ( uint value ) : void |
Writes a 32 bit value as a varint. The fast route is taken when there's enough buffer space left to whizz through without checking for each byte; otherwise, we resort to calling WriteRawByte each time.
|
|
WriteRawVarint64 ( ulong value ) : void |
public CodedOutputStream ( Stream output ) : System | ||
output | Stream | The stream to write to. It will be disposed when the returned |
return | System |
public CodedOutputStream ( Stream output, bool leaveOpen ) : System | ||
output | Stream | The stream to write to. |
leaveOpen | bool | If |
return | System |
public CodedOutputStream ( Stream output, int bufferSize ) : System | ||
output | Stream | The stream to write to. It will be disposed when the returned |
bufferSize | int | The size of buffer to use internally. |
return | System |
public CodedOutputStream ( Stream output, int bufferSize, bool leaveOpen ) : System | ||
output | Stream | The stream to write to. |
bufferSize | int | The size of buffer to use internally. |
leaveOpen | bool | If |
return | System |
public CodedOutputStream ( byte flatArray ) : System | ||
flatArray | byte | |
return | System |
public WriteBool ( bool value ) : void | ||
value | bool | The value to write |
return | void |
public WriteBytes ( ByteString value ) : void | ||
value | ByteString | The value to write |
return | void |
public WriteDouble ( double value ) : void | ||
value | double | The value to write |
return | void |
public WriteEnum ( int value ) : void | ||
value | int | The value to write |
return | void |
public WriteFixed32 ( uint value ) : void | ||
value | uint | The value to write |
return | void |
public WriteFixed64 ( ulong value ) : void | ||
value | ulong | The value to write |
return | void |
public WriteFloat ( float value ) : void | ||
value | float | The value to write |
return | void |
public WriteInt32 ( int value ) : void | ||
value | int | The value to write |
return | void |
public WriteInt64 ( long value ) : void | ||
value | long | The value to write |
return | void |
public WriteLength ( int length ) : void | ||
length | int | Length value, in bytes. |
return | void |
public WriteMessage ( IMessage value ) : void | ||
value | IMessage | The value to write |
return | void |
public WriteRawTag ( byte b1 ) : void | ||
b1 | byte | The encoded tag |
return | void |
public WriteRawTag ( byte b1, byte b2 ) : void | ||
b1 | byte | The first byte of the encoded tag |
b2 | byte | The second byte of the encoded tag |
return | void |
public WriteRawTag ( byte b1, byte b2, byte b3 ) : void | ||
b1 | byte | The first byte of the encoded tag |
b2 | byte | The second byte of the encoded tag |
b3 | byte | The third byte of the encoded tag |
return | void |
public WriteRawTag ( byte b1, byte b2, byte b3, byte b4 ) : void | ||
b1 | byte | The first byte of the encoded tag |
b2 | byte | The second byte of the encoded tag |
b3 | byte | The third byte of the encoded tag |
b4 | byte | The fourth byte of the encoded tag |
return | void |
public WriteRawTag ( byte b1, byte b2, byte b3, byte b4, byte b5 ) : void | ||
b1 | byte | The first byte of the encoded tag |
b2 | byte | The second byte of the encoded tag |
b3 | byte | The third byte of the encoded tag |
b4 | byte | The fourth byte of the encoded tag |
b5 | byte | The fifth byte of the encoded tag |
return | void |
public WriteSFixed32 ( int value ) : void | ||
value | int | The value to write. |
return | void |
public WriteSFixed64 ( long value ) : void | ||
value | long | The value to write |
return | void |
public WriteSInt32 ( int value ) : void | ||
value | int | The value to write |
return | void |
public WriteSInt64 ( long value ) : void | ||
value | long | The value to write |
return | void |
public WriteString ( string value ) : void | ||
value | string | The value to write |
return | void |
public WriteTag ( int fieldNumber, WireFormat type ) : void | ||
fieldNumber | int | The number of the field to write the tag for |
type | WireFormat | The wire format type of the tag to write |
return | void |
public WriteUInt32 ( uint value ) : void | ||
value | uint | The value to write |
return | void |
public WriteUInt64 ( ulong value ) : void | ||
value | ulong | The value to write |
return | void |