Package encoder.primitive

Source Code of encoder.primitive.BigIntEncoderTest

package encoder.primitive;

import decoder.primitive.NumberDecoder;
import org.junit.Assert;
import org.junit.Test;

import java.io.ByteArrayInputStream;
import java.math.BigInteger;

/**
* If you see it, than I've forgotten javadoc
*
* @author Denis Golovachev
* @author $Author$ (current maintainer)
* @since 1.0
*/
public class BigIntEncoderTest {
    @Test
    public void testEncode() throws Exception {
        BigInteger num = new BigInteger
                ("34833033790981183642218815852910710788937631063684158965387798388844821552177");
        byte[] encoded = new BigIntEncoder().encode(num);
        Assert.assertEquals(num.toString(), new NumberDecoder(256).decode(new ByteArrayInputStream(encoded)).toString());
    }
}
TOP

Related Classes of encoder.primitive.BigIntEncoderTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.