public static long getValueAsLong ( final byte [ ] key , final Map < byte [ ] , byte [ ] > taskValues ) { byte [ ] value = taskValues . get ( key ) ; if ( value != null ) { try { long retValue = Bytes . toLong ( value ) ; return retValue ; } catch ( NumberFormatException nfe ) { LOG . error ( "Caught NFE while converting to long " , nfe ) ; return 0L ; } catch ( IllegalArgumentException iae ) { // for exceptions like java.lang.IllegalArgumentException: // offset (0) + length (8) exceed the capacity of the array: 7 LOG . error ( "Caught IAE while converting to long " , iae ) ; return 0L ; } } else { return 0L ; } }
return a value from the NavigableMap as a long