Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

BinaryReader.Read7BitEncodedInt Method

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Reads in a 32-bit integer in compressed format.

Namespace:  System.IO
Assembly:  mscorlib (in mscorlib.dll)

protected internal int Read7BitEncodedInt()

Return Value

Type: System.Int32
A 32-bit integer in compressed format.

ExceptionCondition
EndOfStreamException

The end of the stream is reached.

ObjectDisposedException

The stream is closed.

IOException

An I/O error occurs.

FormatException

The stream is corrupted.

BinaryReader does not restore the file position after an unsuccessful read.

If the integer will fit in seven bits, the integer takes only one byte of space. The integer is expected to have been written through BinaryWriter.Write7BitEncodedInt.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show: