gets method

int gets(
  1. int addr,
  2. int length
)

get the buffer at this address

Implementation

int gets(int addr, int length){
  //Get string of bytes from given address. If any entries are blank
  //from addr through addr+length, a NotEnoughDataError exception will
  //be raised. Padding is not used.
  String a = '';
  try{
    for(int i = 0;i < length; i++){
      a += buffer[addr+i]!.toRadixString(16);
    }
  }
  catch(keyError){
    throw AssertionError('Error at address: $addr and length: $length');
  }
  return int.parse('0x$a');
}