private int readNext(boolean charstring){
  num=(int)(data[pos++]) & 0xff;
  if (num == 30 && !charstring) {
    readFNum();
    return type=FLT;
  }
 else   if (num == 28) {
    num=(((int)data[pos]) << 8) + (((int)data[pos + 1]) & 0xff);
    pos+=2;
    return type=NUM;
  }
 else   if (num == 29 && !charstring) {
    num=(((int)data[pos] & 0xff) << 24) | (((int)data[pos + 1] & 0xff) << 16) | (((int)data[pos + 2] & 0xff) << 8)| (((int)data[pos + 3] & 0xff));
    pos+=4;
    return type=NUM;
  }
 else   if (num == 12) {
    num=1000 + ((int)(data[pos++]) & 0xff);
    return type=CMD;
  }
 else   if (num < 32) {
    return type=CMD;
  }
 else   if (num < 247) {
    num-=139;
    return type=NUM;
  }
 else   if (num < 251) {
    num=(num - 247) * 256 + (((int)data[pos++]) & 0xff) + 108;
    return type=NUM;
  }
 else   if (num < 255) {
    num=-(num - 251) * 256 - (((int)data[pos++]) & 0xff) - 108;
    return type=NUM;
  }
 else   if (!charstring) {
    printData();
    throw new RuntimeException("Got a 255 code while reading dict");
  }
 else {
    fnum=((((int)data[pos] & 0xff) << 24) | (((int)data[pos + 1] & 0xff) << 16) | (((int)data[pos + 2] & 0xff) << 8)| (((int)data[pos + 3] & 0xff))) / 65536f;
    pos+=4;
    return type=FLT;
  }
}

private int readNext ( boolean charstring ) { num = ( int ) ( data [ pos ++ ] ) & 0xff ; if ( num == 30 && ! charstring ) { readFNum ( ) ; return type = FLT ; } else if ( num == 28 ) { num = ( ( ( int ) data [ pos ] ) << 8 ) + ( ( ( int ) data [ pos + 1 ] ) & 0xff ) ; pos += 2 ; return type = NUM ; } else if ( num == 29 && ! charstring ) { num = ( ( ( int ) data [ pos ] & 0xff ) << 24 ) | ( ( ( int ) data [ pos + 1 ] & 0xff ) << 16 ) | ( ( ( int ) data [ pos + 2 ] & 0xff ) << 8 ) | ( ( ( int ) data [ pos + 3 ] & 0xff ) ) ; pos += 4 ; return type = NUM ; } else if ( num == 12 ) { num = 1000 + ( ( int ) ( data [ pos ++ ] ) & 0xff ) ; return type = CMD ; } else if ( num < 32 ) { return type = CMD ; } else if ( num < 247 ) { num -= 139 ; return type = NUM ; } else if ( num < 251 ) { num = ( num - 247 ) * 256 + ( ( ( int ) data [ pos ++ ] ) & 0xff ) + 108 ; return type = NUM ; } else if ( num < 255 ) { num = - ( num - 251 ) * 256 - ( ( ( int ) data [ pos ++ ] ) & 0xff ) - 108 ; return type = NUM ; } else if ( ! charstring ) { printData ( ) ; throw new RuntimeException ( "Got a 255 code while reading dict" ) ; } else { fnum = ( ( ( ( int ) data [ pos ] & 0xff ) << 24 ) | ( ( ( int ) data [ pos + 1 ] & 0xff ) << 16 ) | ( ( ( int ) data [ pos + 2 ] & 0xff ) << 8 ) | ( ( ( int ) data [ pos + 3 ] & 0xff ) ) ) / 65536f ; pos += 4 ; return type = FLT ; } }
read the next decoded value from the stream
