Package decoder.primitive

Examples of decoder.primitive.IntDecoder


public class IntEncoderTest {
    @Test
    public void testEncode() throws Exception {
        Integer num = 54;
        byte[] encoded = new IntEncoder().encode(num);
        Assert.assertEquals(num, new IntDecoder().decode(new ByteArrayInputStream(encoded)));
    }
View Full Code Here


    @Test
    public void testEncode2() throws Exception {
        Integer num = 123455634;
        byte[] encoded = new IntEncoder().encode(num);
        Assert.assertEquals(num, new IntDecoder().decode(new ByteArrayInputStream(encoded)));
    }
View Full Code Here

    public static final Map<Class, Decoder> decodersMap = DefaultDecoderConfig.decodersMap();

    public static Map<Class, Decoder> decodersMap() {
        Map<Class, Decoder> decoderMap = new HashMap<>();
        decoderMap.put(String.class, new HexStringDecoder());
        decoderMap.put(Integer.class, new IntDecoder());
        decoderMap.put(Long.class, new LongDecoder());
        decoderMap.put(Long.class, new LongDecoder());
        decoderMap.put(Vector.class, new VectorDecoder());
        return decoderMap;
    }
View Full Code Here

TOP

Related Classes of decoder.primitive.IntDecoder

Copyright © 2018 www.massapicom. 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.