C# Class FoundationDB.Client.SliceReader

Helper class that holds the internal state used to parse tuples from slices
Exibir arquivo Open project: BedeGaming/foundationdb-dotnet-client Class Usage Examples

Public Properties

Property Type Description
Position int

Public Methods

Method Description
EnsureBytes ( int count ) : void

Ensure that there are at least count bytes remaining in the buffer

FromBuffer ( byte buffer ) : SliceReader

Creates a reader on a byte array

FromBuffer ( byte buffer, int offset, int count ) : SliceReader

Creates a reader on a segment of a byte array

ReadByte ( ) : byte

Read the next byte from the buffer

ReadByteString ( ) : Slice

Read an encoded nul-terminated byte array from the buffer

ReadBytes ( int count ) : Slice

Read the next count bytes from the buffer

ReadFixed16 ( ) : ushort

Read the next 2 bytes as an unsigned 16-bit integer, encoded in little-endian

ReadFixed16BE ( ) : ushort

Read the next 2 bytes as an unsigned 16-bit integer, encoded in big-endian

ReadFixed32 ( ) : uint

Read the next 4 bytes as an unsigned 32-bit integer, encoded in little-endian

ReadFixed32BE ( ) : uint

Read the next 4 bytes as an unsigned 32-bit integer, encoded in big-endian

ReadFixed64 ( ) : ulong

Read the next 8 bytes as an unsigned 64-bit integer, encoded in little-endian

ReadFixed64BE ( ) : ulong

Read the next 8 bytes as an unsigned 64-bit integer, encoded in big-endian

ReadVarbytes ( ) : Slice

Reads a variable sized slice, by first reading its size (stored as a Varint32) and then the data

ReadVarint16 ( ) : ushort

Reads a 7-bit encoded unsigned int (aka 'Varint16') from the buffer, and advances the cursor

Can Read up to 3 bytes from the input

ReadVarint32 ( ) : uint

Reads a 7-bit encoded unsigned int (aka 'Varint32') from the buffer, and advances the cursor

Can Read up to 5 bytes from the input

ReadVarint64 ( ) : ulong

Reads a 7-bit encoded unsigned long (aka 'Varint32') from the buffer, and advances the cursor

Can Read up to 10 bytes from the input

Skip ( int count ) : void

Skip the next count bytes of the buffer

SliceReader ( Slice buffer ) : JetBrains.Annotations

Creates a new reader over a slice

Private Methods

Method Description
PeekByte ( ) : int
ReadVarint ( int count ) : ulong

Reads a Base 128 Varint from the input

Method Details

EnsureBytes() public method

Ensure that there are at least count bytes remaining in the buffer
public EnsureBytes ( int count ) : void
count int
return void

FromBuffer() public static method

Creates a reader on a byte array
public static FromBuffer ( byte buffer ) : SliceReader
buffer byte
return SliceReader

FromBuffer() public static method

Creates a reader on a segment of a byte array
public static FromBuffer ( byte buffer, int offset, int count ) : SliceReader
buffer byte
offset int
count int
return SliceReader

ReadByte() public method

Read the next byte from the buffer
public ReadByte ( ) : byte
return byte

ReadByteString() public method

Read an encoded nul-terminated byte array from the buffer
public ReadByteString ( ) : Slice
return Slice

ReadBytes() public method

Read the next count bytes from the buffer
public ReadBytes ( int count ) : Slice
count int
return Slice

ReadFixed16() public method

Read the next 2 bytes as an unsigned 16-bit integer, encoded in little-endian
public ReadFixed16 ( ) : ushort
return ushort

ReadFixed16BE() public method

Read the next 2 bytes as an unsigned 16-bit integer, encoded in big-endian
public ReadFixed16BE ( ) : ushort
return ushort

ReadFixed32() public method

Read the next 4 bytes as an unsigned 32-bit integer, encoded in little-endian
public ReadFixed32 ( ) : uint
return uint

ReadFixed32BE() public method

Read the next 4 bytes as an unsigned 32-bit integer, encoded in big-endian
public ReadFixed32BE ( ) : uint
return uint

ReadFixed64() public method

Read the next 8 bytes as an unsigned 64-bit integer, encoded in little-endian
public ReadFixed64 ( ) : ulong
return ulong

ReadFixed64BE() public method

Read the next 8 bytes as an unsigned 64-bit integer, encoded in big-endian
public ReadFixed64BE ( ) : ulong
return ulong

ReadVarbytes() public method

Reads a variable sized slice, by first reading its size (stored as a Varint32) and then the data
public ReadVarbytes ( ) : Slice
return Slice

ReadVarint16() public method

Reads a 7-bit encoded unsigned int (aka 'Varint16') from the buffer, and advances the cursor
Can Read up to 3 bytes from the input
public ReadVarint16 ( ) : ushort
return ushort

ReadVarint32() public method

Reads a 7-bit encoded unsigned int (aka 'Varint32') from the buffer, and advances the cursor
Can Read up to 5 bytes from the input
public ReadVarint32 ( ) : uint
return uint

ReadVarint64() public method

Reads a 7-bit encoded unsigned long (aka 'Varint32') from the buffer, and advances the cursor
Can Read up to 10 bytes from the input
public ReadVarint64 ( ) : ulong
return ulong

Skip() public method

Skip the next count bytes of the buffer
public Skip ( int count ) : void
count int
return void

SliceReader() public method

Creates a new reader over a slice
public SliceReader ( Slice buffer ) : JetBrains.Annotations
buffer Slice Slice that will be used as the underlying buffer
return JetBrains.Annotations

Property Details

Position public_oe property

Current position inside the buffer
public int Position
return int