public static byte[] unpackGTSId(BigInteger bi){
  byte[] bytes=bi.toByteArray();
  if (bytes.length < 16) {
    byte[] tmp=new byte[16];
    if (bi.signum() < 0) {
      Arrays.fill(tmp,(byte)0xff);
    }
    System.arraycopy(bytes,0,tmp,tmp.length - bytes.length,bytes.length);
    return tmp;
  }
 else {
    return bytes;
  }
}

public static byte [ ] unpackGTSId ( BigInteger bi ) { byte [ ] bytes = bi . toByteArray ( ) ; if ( bytes . length < 16 ) { byte [ ] tmp = new byte [ 16 ] ; if ( bi . signum ( ) < 0 ) { Arrays . fill ( tmp , ( byte ) 0xff ) ; } System . arraycopy ( bytes , 0 , tmp , tmp . length - bytes . length , bytes . length ) ; return tmp ; } else { return bytes ; } }
convert a gts id packed as a biginteger into an array of bytes containing classid / labelsid in big endian representation
