Class BinaryParser
BinaryParser is used to compute fields and values from a HexString
Namespace: Xrpl.BinaryCodec.Binary
Assembly: Xrpl.BinaryCodec.dll
Syntax
public abstract class BinaryParser
Fields
| Edit this page View SourceCursor
cursor position
Declaration
protected int Cursor
Field Value
| Type | Description |
|---|---|
| int |
Size
Parser size
Declaration
protected int Size
Field Value
| Type | Description |
|---|---|
| int |
Methods
| Edit this page View SourceEnd()
END of parser
Declaration
public bool End()
Returns
| Type | Description |
|---|---|
| bool | bool result |
End(int?)
END of parser
Declaration
public bool End(int? customEnd)
Parameters
| Type | Name | Description |
|---|---|---|
| int? | customEnd | current cursor position |
Returns
| Type | Description |
|---|---|
| bool | bool result |
Peek()
Consume the first n bytes of the BinaryParser
Declaration
public abstract byte Peek()
Returns
| Type | Description |
|---|---|
| byte |
Pos()
Cursor position
Declaration
public int Pos()
Returns
| Type | Description |
|---|---|
| int | Cursor position |
Read(int)
read the first n bytes from the BinaryParser
Declaration
public abstract byte[] Read(int n)
Parameters
| Type | Name | Description |
|---|---|---|
| int | n | The number of bytes to read |
Returns
| Type | Description |
|---|---|
| byte[] | The bytes |
ReadField()
Read the field from the BinaryParser
Declaration
public Field ReadField()
Returns
| Type | Description |
|---|---|
| Field | The field represented by the bytes at the head of the BinaryParser |
Exceptions
| Type | Condition |
|---|---|
| InvalidOperationException | Couldn't parse field |
ReadFieldCode()
Reads the field ordinal from the BinaryParser
Declaration
public int ReadFieldCode()
Returns
| Type | Description |
|---|---|
| int | Field ordinal |
ReadOne()
read the byte from the BinaryParser by current cursor position
Declaration
public abstract byte ReadOne()
Returns
| Type | Description |
|---|---|
| byte |
ReadOneInt()
Read an integer of given size
Declaration
public int ReadOneInt()
Returns
| Type | Description |
|---|---|
| int |
ReadUInt8()
Declaration
public abstract byte ReadUInt8()
Returns
| Type | Description |
|---|---|
| byte |
ReadVlLength()
Reads variable length encoded bytes
Declaration
public int ReadVlLength()
Returns
| Type | Description |
|---|---|
| int | The variable length bytes |
Exceptions
| Type | Condition |
|---|---|
| InvalidOperationException | Invalid variable length indicator |
Skip(int)
todo
Declaration
public abstract void Skip(int n)
Parameters
| Type | Name | Description |
|---|---|---|
| int | n | n the number of bytes to skip |