CellSlice
TonSdk.Core.Boc
CellSlice
represents slice - a special object which allows you to read from a cell.
CellSlice
instance can be create via constructor with speceifing Cell
or directly via Cell
mutation with using method Parse
:
Its prefer to use Parse
method when you want to parse cell into slice. It will make you code more readable and shorten.
Below you can see the methods what can be used.
SkipRefs(int size)
- skips specified refs count and return new sliceSkipRef
- skip one ref and return new sliceSkipOptRef
- firstly load one bit, if ittrue
skip ref, return new sliceReadRefs(int size)
- read specified refs count and returnCell[]
without slice mutationReadRef
- read one ref and returnCell
without slice mutationReadOptRef
- firstly read one bit, if ittrue
read ref and return it, otherwise return null, without slice mutationLoadRefs(int size)
- load specified refs count and returnCell[]
LoadRef
- read one ref and returnCell
LoadOptRef
- firstly load one bit, if ittrue
load ref and return it, otherwise return null
ReadDict(HasmapOptions opt)
- read and returnHashmapE
with specifiedHashmapOptions
, without slice mutationLoadDict(HasmapOptions opt)
- laod and returnHashmapE
with specifiedHashmapOptions
SkipBits(int size)
- skips specified bits count and return new sliceSkipBit
- skip one bit and return new sliceReadBits(int size)
- read specified bits count and returnBits
without slice mutationReadBit
- read one bit and returnbool
without slice mutationLoadBits(int size)
- load specified bits count and returnBits
LoadBit
- read one bit and returnbool
ReadUint(int size)
- read uint with spicified size and returnBigInteger
without slice mutationLoadUint(int size)
- load uint with spicified size and returnBigInteger
ReadInt(int size)
- read int with spicified size and returnBigInteger
without slice mutationLoadInt(int size)
- load int with spicified size and returnBigInteger
ReadUInt32LE
- read uint in Little-Endian order and returnBigInteger
without slice mutationLoadUInt32LE
- load uint in Little-Endian order and returnBigInteger
ReadUInt64LE
- read ulong in Little-Endian order and returnBigInteger
without slice mutationLoadUInt64LE
- load ulong in Little-Endian order and returnBigInteger
ReadCoins(int decimals = 9)
- read and returnCoins
with specified decimals count, without slice mutationLoadCoins(int decimals = 9)
- load and returnCoins
with specified decimals count
ReadVarUInt(int length)
- readVarUInt
with spicified length and returnBigInteger
without slice mutationLoadVarUInt(int length)
- loadVarUInt
with spicified length and returnBigInteger
ReadVarInt(int length)
- readVarInt
with spicified length and returnBigInteger
without slice mutationLoadVarInt(int length)
- loadVarInt
with spicified length and returnBigInteger
ReadAddress
- read and returnAddress
, without slice mutationLoadAddress
- load and returnAddress
ReadBytes(int size)
- read and returnbyte[]
, without slice mutationLoadBytes(int size)
- load and returnbyte[]
ReadString
- read all remainder bytes and return asstring
, without slice mutationReadString(int size)
- readsize
bytes and return asstring
, without slice mutationLoadString
- load all remainder bytes and return asstring
LoadString(int size)
- loadsize
bytes and return asstring
, without slice mutation
You can restore remainder data as Cell
using RestoreRemainder
:
also you can restore source cell using Restore
:
Its also possible to clone current slice with using Clone
:
Last updated