@aldea/sdk / Exports / BufReader
Class: BufReader
BufReader.
Class used for reading encoded data chunk by chunk. Normally used with the BCS wrapper, but can also be used as a gerneal purpose Buffer reader.
Table of contents
Constructors
Properties
Accessors
Methods
- _readVarInt
- read
- readBool
- readBytes
- readF32
- readF64
- readFixedBytes
- readFixedSeq
- readI16
- readI32
- readI64
- readI8
- readSeq
- readU16
- readU32
- readU64
- readU8
- readULEB
Constructors
constructor
• new BufReader(data
): BufReader
Parameters
Name | Type |
---|---|
data | Uint8Array |
Returns
Defined in
packages/core/dist/bcs/buf-reader.d.ts:15
Properties
cursor
• cursor: number
Defined in
packages/core/dist/bcs/buf-reader.d.ts:13
pull
• Private
pull: any
Defined in
packages/core/dist/bcs/buf-reader.d.ts:35
view
• view: DataView
Defined in
packages/core/dist/bcs/buf-reader.d.ts:14
Accessors
remaining
• get
remaining(): number
Returns
number
Defined in
packages/core/dist/bcs/buf-reader.d.ts:16
Methods
_readVarInt
▸ _readVarInt(): number
| bigint
Returns
number
| bigint
Defined in
packages/core/dist/bcs/buf-reader.d.ts:34
read
▸ read<T
>(serializer
): T
Type parameters
Name |
---|
T |
Parameters
Name | Type |
---|---|
serializer | Serializable <T > |
Returns
T
Defined in
packages/core/dist/bcs/buf-reader.d.ts:33
readBool
▸ readBool(): boolean
Returns
boolean
Defined in
packages/core/dist/bcs/buf-reader.d.ts:17
readBytes
▸ readBytes(): Uint8Array
Returns
Uint8Array
Defined in
packages/core/dist/bcs/buf-reader.d.ts:30
readF32
▸ readF32(): number
Returns
number
Defined in
packages/core/dist/bcs/buf-reader.d.ts:18
readF64
▸ readF64(): number
Returns
number
Defined in
packages/core/dist/bcs/buf-reader.d.ts:19
readFixedBytes
▸ readFixedBytes(length
): Uint8Array
Parameters
Name | Type |
---|---|
length | number |
Returns
Uint8Array
Defined in
packages/core/dist/bcs/buf-reader.d.ts:29
readFixedSeq
▸ readFixedSeq<T
>(length
, cb
): T
[]
Type parameters
Name |
---|
T |
Parameters
Name | Type |
---|---|
length | number |
cb | BufReaderSeqCallback <T > |
Returns
T
[]
Defined in
packages/core/dist/bcs/buf-reader.d.ts:31
readI16
▸ readI16(): number
Returns
number
Defined in
packages/core/dist/bcs/buf-reader.d.ts:21
readI32
▸ readI32(): number
Returns
number
Defined in
packages/core/dist/bcs/buf-reader.d.ts:22
readI64
▸ readI64(): bigint
Returns
bigint
Defined in
packages/core/dist/bcs/buf-reader.d.ts:23
readI8
▸ readI8(): number
Returns
number
Defined in
packages/core/dist/bcs/buf-reader.d.ts:20
readSeq
▸ readSeq<T
>(cb
): T
[]
Type parameters
Name |
---|
T |
Parameters
Name | Type |
---|---|
cb | BufReaderSeqCallback <T > |
Returns
T
[]
Defined in
packages/core/dist/bcs/buf-reader.d.ts:32
readU16
▸ readU16(): number
Returns
number
Defined in
packages/core/dist/bcs/buf-reader.d.ts:25
readU32
▸ readU32(): number
Returns
number
Defined in
packages/core/dist/bcs/buf-reader.d.ts:26
readU64
▸ readU64(): bigint
Returns
bigint
Defined in
packages/core/dist/bcs/buf-reader.d.ts:27
readU8
▸ readU8(): number
Returns
number
Defined in
packages/core/dist/bcs/buf-reader.d.ts:24
readULEB
▸ readULEB(): number
Returns
number
Defined in
packages/core/dist/bcs/buf-reader.d.ts:28