public String lookup ( byte [ ] code , int offset , int length ) { String result = null ; Integer key = null ; if ( length == 1 ) { key = Integer . valueOf ( code [ offset ] & 0xff ) ; result = ( String ) singleByteMappings . get ( key ) ; } else if ( length == 2 ) { int intKey = code [ offset ] & 0xff ; intKey <<= 8 ; intKey += code [ offset + 1 ] & 0xff ; key = Integer . valueOf ( intKey ) ; result = ( String ) doubleByteMappings . get ( key ) ; } return result ; }
This will perform a lookup into the map .