public static Identifier fromLong ( long longValue , int desiredByteLength ) { if ( desiredByteLength < 0 ) { throw new IllegalArgumentException ( "Identifier length must be > 0." ) ; } byte [ ] newValue = new byte [ desiredByteLength ] ; for ( int i = desiredByteLength - 1 ; i >= 0 ; i -- ) { newValue [ i ] = ( byte ) ( longValue & 0xff ) ; longValue = longValue >> 8 ; } return new Identifier ( newValue ) ; }
Creates an Identifer backed by an array of length desiredByteLength