private static byte [ ] idInBytes ( final short idwidth , final long lid ) { if ( idwidth <= 0 ) { throw new AssertionError ( "negative idwidth: " + idwidth ) ; } final byte [ ] id = Bytes . fromLong ( lid ) ; for ( int i = 0 ; i < id . length - idwidth ; i ++ ) { if ( id [ i ] != 0 ) { System . err . println ( lid + " is too large to fit on " + idwidth + " bytes. Maybe you forgot to adjust --idwidth?" ) ; return null ; } } return Arrays . copyOfRange ( id , id . length - idwidth , id . length ) ; }
Transforms an ID into the corresponding byte array .