author liangqin.fan gmail import { seal_input } from "as-contract-runtime" ; import { ReadBuffer } from "./readbuffer" ; export class MessageInputReader { private readbuf : ReadBuffer ; static readInput ( ) { return new MessageInputReader ( 1024 ) ; } private constructor ( bufSize ) { this . readbuf = new ReadBuffer ( bufSize ) ; seal_input ( this . readbuf . valueBuffer , this . readbuf . sizeBuffer ) ; } get fnSelector ( ) : u8 [ ] { return this . readbuf . valueBytes . slice ( 0 , 4 ) ; } get fnParameters ( ) : u8 [ ] { if ( this . readbuf . valueBytes . length == 4 ) return [ ] ; return this . readbuf . valueBytes . slice ( 4 ) ; } }