@ Override public Number readNumber ( ) { if ( buf . hasRemaining ( ) ) { int remaining = buf . remaining ( ) ; if ( log . isTraceEnabled ( ) ) { log . trace ( "Remaining bytes for Number: {}" , remaining ) ; } Number v ; if ( currentDataType == AMF3 . TYPE_NUMBER ) { // prevent buffer underrun if we dont have 8 bytes for the expected double if ( remaining >= 8 ) { v = buf . getDouble ( ) ; } else { v = buf . getInt ( ) ; } } else { // we are decoding an int v = readInteger ( ) ; } if ( log . isTraceEnabled ( ) ) { log . trace ( "readNumber - value: {}" , v ) ; } return v ; } else { log . warn ( "No remaining bytes for buffer readNumber" ) ; } return null ; }
Reads a Number