public Number readNumber(Type target){
  double num=buf.getDouble();
  if (num == Math.round(num)) {
    if (num < Integer.MAX_VALUE) {
      return (int)num;
    }
 else {
      return Math.round(num);
    }
  }
 else {
    return num;
  }
}

public Number readNumber ( Type target ) { double num = buf . getDouble ( ) ; if ( num == Math . round ( num ) ) { if ( num < Integer . MAX_VALUE ) { return ( int ) num ; } else { return Math . round ( num ) ; } } else { return num ; } }
reads a number . in actionscript 1 and 2 number type represents all numbers , both floats and integers .
