Szerkesztés

Megosztás a következőn keresztül:


BinaryWriter.Write7BitEncodedInt(Int32) Method

Definition

Writes a 32-bit integer in a compressed format.

protected:
 void Write7BitEncodedInt(int value);
public:
 void Write7BitEncodedInt(int value);
protected void Write7BitEncodedInt (int value);
public void Write7BitEncodedInt (int value);
member this.Write7BitEncodedInt : int -> unit
Protected Sub Write7BitEncodedInt (value As Integer)
Public Sub Write7BitEncodedInt (value As Integer)

Parameters

value
Int32

The 32-bit integer to be written.

Exceptions

The end of the stream is reached.

The stream is closed.

The stream is closed.

Remarks

The integer of the value parameter is written out seven bits at a time, starting with the seven least-significant bits. The high bit of a byte indicates whether there are more bytes to be written after this one.

If value will fit in seven bits, it takes only one byte of space. If value will not fit in seven bits, the high bit is set on the first byte and written out. value is then shifted by seven bits and the next byte is written. This process is repeated until the entire integer has been written.

For a list of common I/O tasks, see Common I/O Tasks.

Applies to