common/src/main/java/com/genexus/util/HexUtil.java
/**
     * Write a (reasonably short) BigInteger to a stream.
     * @param integer the BigInteger to write
     * @param out the stream to write it to
     */
Write a (reasonably short) BigInteger to a stream.
@param integer the BigInteger to write
@param out the stream to write it to
Write a ( reasonably short ) BigInteger to a stream . @param integer the BigInteger to write @param out the stream to write it to
public static void writeBigInteger(BigInteger integer, DataOutputStream out) throws IOException {
        if(integer.signum() == -1) {
            throw new IllegalStateException("Negative BigInteger!");
        }
        byte[] buf = integer.toByteArray();
        if(buf.length > Short.MAX_VALUE)
            throw new IllegalStateException("Too long: "+buf.length);
        out.writeShort((short)buf.length);
        out.write(buf);
    }
public static void writeBigInteger ( BigInteger integer , DataOutputStream out ) throws IOException { if ( integer . signum ( ) == - 1 ) { throw new IllegalStateException ( "Negative BigInteger!" ) ; } byte [ ] buf = integer . toByteArray ( ) ; if ( buf . length > Short . MAX_VALUE ) throw new IllegalStateException ( "Too long: " + buf . length ) ; out . writeShort ( ( short ) buf . length ) ; out . write ( buf ) ; }
Write a (reasonably short) BigInteger to a stream.
Write a ( reasonably short ) BigInteger to a stream .
//dump("Negative BigInteger", Logger.ERROR, true);