Examples of DecodeResult


Examples of com.fineqt.fpb.lib.codec.DecodeResult

        }

        @Override
        protected DecodeResult postDecode(DecodeContext cxt, IReadableBitBuffer input,
                DecodeParameters paras, DecodeResult result) throws DecodeException {
            DecodeResult ret = super.postDecode(cxt, input, paras, result);
            PFieldExt fieldMeta = (PFieldExt)paras.getItemFieldMeta();
            //已解码Header的处理
            if (fieldMeta != null && fieldMeta.getFieldID() == HTTP_MESSAGE__HEADERS) {
                IFactory factory = getPModule().getFactory();
                CommonContext.FieldStackMap fieldStack = cxt.getFieldStackMap();
View Full Code Here

Examples of com.fineqt.fpb.lib.codec.DecodeResult

        }

        @Override
        protected DecodeResult postDecode(DecodeContext cxt, IReadableBitBuffer input,
                DecodeParameters paras, DecodeResult result) throws DecodeException {
            DecodeResult ret = super.postDecode(cxt, input, paras, result);
            if (ret.getValue() != null) {
                //设置chunkLength
                IContainerValue value = (IContainerValue)ret.getValue();
                IValue lenValue = value.getField(HTTP_CHUNK_LENGTH_LINE__CHUNK_LENGTH);
                IIntegerValue intValue = (IIntegerValue)cxt.getFieldStackMap().peekField(
                        StackFields.CHUNK_LENGTH);
                if (intValue == null) {
                    intValue = getPModule().getFactory().createInteger();
View Full Code Here

Examples of com.foundationdb.tuple.TupleUtil.DecodeResult

    @Test
    public void doubleEncodingTest() {
        Double initDouble = 4.5;
        byte[] bytes = TupleFloatingUtil.encode(initDouble);
        DecodeResult result = TupleFloatingUtil.decodeDouble(bytes, 1);
        assertEquals(initDouble, (Double) result.o);
       
        initDouble = -4.5;
        bytes = TupleFloatingUtil.encode(initDouble);
        result = TupleFloatingUtil.decodeDouble(bytes, 1);
View Full Code Here

Examples of com.foundationdb.tuple.TupleUtil.DecodeResult

   
    @Test
    public void floatEncodingTest() {
        Float initFloat = (float) 4.5;
        byte[] bytes = TupleFloatingUtil.encode(initFloat);
        DecodeResult result = TupleFloatingUtil.decodeFloat(bytes, 1);
        assertEquals(initFloat, (Float) result.o);
       
        initFloat = (float) -4.5;
        bytes = TupleFloatingUtil.encode(initFloat);
        result = TupleFloatingUtil.decodeFloat(bytes, 1);
View Full Code Here

Examples of com.foundationdb.tuple.TupleUtil.DecodeResult

   
    @Test
    public void bigIntEncodingTest() {
        BigInteger bigInteger = new BigInteger("12345678912345");
        byte[] bytes = TupleFloatingUtil.encode(bigInteger);
        DecodeResult result = TupleFloatingUtil.decodeBigInt(bytes, 1);
        assertEquals(bigInteger, (BigInteger) result.o);
       
        bigInteger = new BigInteger("-12345678912345");
        bytes = TupleFloatingUtil.encode(bigInteger);
        result = TupleFloatingUtil.decodeBigInt(bytes, 1);
View Full Code Here

Examples of com.foundationdb.tuple.TupleUtil.DecodeResult

   
    @Test
    public void bigDecEncodingTest() {
        BigDecimal bigDecimal = new BigDecimal("123456789.123456789");
        byte[] bytes = TupleFloatingUtil.encode(bigDecimal);
        DecodeResult result = TupleFloatingUtil.decodeBigDecimal(bytes, 1);
        assertEquals(bigDecimal, (BigDecimal) result.o);
       
        bigDecimal = new BigDecimal("-123456789.123456789");
        bytes = TupleFloatingUtil.encode(bigDecimal);
        result = TupleFloatingUtil.decodeBigDecimal(bytes, 1);
View Full Code Here

Examples of com.foundationdb.tuple.TupleUtil.DecodeResult

    @Test
    public void booleanEncodingTest() {
        Boolean bool = new Boolean(true);
        byte[] bytes = TupleFloatingUtil.encode(bool);
        DecodeResult result = TupleFloatingUtil.decode(bytes, 0, 1);
        assertEquals(bool, (Boolean) result.o);

        bool = new Boolean(false);
        bytes = TupleFloatingUtil.encode(bool);
        result = TupleFloatingUtil.decode(bytes, 0, 1);
View Full Code Here

Examples of com.foundationdb.tuple.TupleUtil.DecodeResult

    }

    static DecodeResult decodeFloat(byte[] bytes, int start) {
        int end = start + FLOAT_LEN;
        bytes = floatingPointCoding(Arrays.copyOfRange(bytes, start, start + FLOAT_LEN), false);
        return new DecodeResult(end, byteArrayToFloat(bytes));
    }
View Full Code Here

Examples of com.foundationdb.tuple.TupleUtil.DecodeResult

    static DecodeResult decodeUUID(byte[] bytes, int start) {
            ByteBuffer bb = ByteBuffer.wrap(bytes, start, UUID_LEN).order(ByteOrder.BIG_ENDIAN);
            long msb = bb.getLong();
            long lsb = bb.getLong();
            return new DecodeResult(start + UUID_LEN, new UUID(msb, lsb));
        }   
View Full Code Here

Examples of com.foundationdb.tuple.TupleUtil.DecodeResult

        }   
   
    static DecodeResult decodeDouble(byte[] bytes, int start) {
        int end = start + DOUBLE_LEN;
        bytes = floatingPointCoding(Arrays.copyOfRange(bytes, start, end), false);
        return new DecodeResult(end, byteArrayToDouble(bytes));
    }
View Full Code Here
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.