public static Long convertToLong ( RLPElement rpe ) { Long result = 0L ; byte [ ] rawBytes = rpe . getRawData ( ) ; if ( ( rawBytes != null ) ) { // fill leading zeros if ( rawBytes . length < EthereumUtil . LONG_SIZE ) { byte [ ] fullBytes = new byte [ EthereumUtil . LONG_SIZE ] ; int dtDiff = EthereumUtil . LONG_SIZE - rawBytes . length ; for ( int i = 0 ; i < rawBytes . length ; i ++ ) { fullBytes [ dtDiff + i ] = rawBytes [ i ] ; result = ByteBuffer . wrap ( fullBytes ) . getLong ( ) ; } } else { result = ByteBuffer . wrap ( rawBytes ) . getLong ( ) ; } } return result ; }
Converts a long in a RLPElement to long