Examples of DecodeResult


Examples of com.foundationdb.tuple.TupleUtil.DecodeResult

    }

    static DecodeResult decodeBigInt(byte[] bytes, int start) {
        int length = Math.abs(decodeIntNoTypeCode(Arrays.copyOfRange(bytes, start, start + INT_LEN)));
        BigInteger bigInt = decodeBigIntNoTypeCode(Arrays.copyOfRange(bytes, start + INT_LEN, start + INT_LEN + length));
        return new DecodeResult(start + INT_LEN + length, bigInt);
    }
View Full Code Here

Examples of com.foundationdb.tuple.TupleUtil.DecodeResult

    static DecodeResult decodeBigDecimal(byte[] bytes, int start) {
        int scale = decodeIntNoTypeCode(Arrays.copyOfRange(bytes, start, start + INT_LEN));
        int length = Math.abs(decodeIntNoTypeCode(Arrays.copyOfRange(bytes, start + INT_LEN, start + INT_LEN * 2)));
        BigInteger bigInt = decodeBigIntNoTypeCode(Arrays.copyOfRange(bytes, start + INT_LEN * 2, start + INT_LEN * 2 + length));
        return new DecodeResult(start + INT_LEN * 2 + length, new BigDecimal(bigInt, scale));
    }
View Full Code Here

Examples of com.foundationdb.tuple.TupleUtil.DecodeResult

    static List<Object> unpack(byte[] bytes, int start, int length) {
        List<Object> items = new LinkedList<Object>();
        int pos = start;
        int end = start + length;
        while(pos < bytes.length) {
            DecodeResult decoded = decode(bytes, pos, end);
            items.add(decoded.o);
            pos = decoded.end;
        }
        return items;
    }
View Full Code Here

Examples of com.foundationdb.tuple.TupleUtil.DecodeResult

        }
        if (code == DOUBLE_CODE) {
            return decodeDouble(rep, start);
        }
        if (code == TRUE_CODE) {
            return new DecodeResult(start, true);
        }
        if (code == FALSE_CODE) {
            return new DecodeResult(start, false);
        }
        if (code == BIGDEC_POS_CODE || code == BIGDEC_NEG_CODE) {
            return decodeBigDecimal(rep, start);
        }
        if (code == BIGINT_POS_CODE || code == BIGINT_NEG_CODE) {
View Full Code Here

Examples of org.apache.pdfbox.filter.DecodeResult

            throws IOException
    {
        this.parameters = parameters;
        this.resources = resources;

        DecodeResult decodeResult = null;
        List<String> filters = getFilters();
        if (filters == null || filters.isEmpty())
        {
            this.stream = new PDMemoryStream(data);
        }
        else
        {
            ByteArrayInputStream in = new ByteArrayInputStream(data);
            ByteArrayOutputStream out = new ByteArrayOutputStream(data.length);
            for (int i = 0; i < filters.size(); i++)
            {
                // TODO handling of abbreviated names belongs here, rather than in other classes
                out.reset();
                Filter filter = FilterFactory.INSTANCE.getFilter(filters.get(i));
                decodeResult = filter.decode(in, out, parameters, i);
                in = new ByteArrayInputStream(out.toByteArray());
            }
            byte[] finalData = out.toByteArray();
            this.stream = new PDMemoryStream(finalData);
        }

        // repair parameters
        if (decodeResult != null)
        {
            parameters.addAll(decodeResult.getParameters());
        }
    }
View Full Code Here

Examples of org.ethereum.util.DecodeResult

      String blockRaw = "f8cbf8c7a00000000000000000000000000000000000000000000000000000000000000000a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347940000000000000000000000000000000000000000a02f4399b08efe68945c1cf90ffe85bbe3ce978959da753f9e649f034015b8817da00000000000000000000000000000000000000000000000000000000000000000834000008080830f4240808080a004994f67dc55b09e814ab7ffc8df3686b4afb2bb53e60eae97ef043fe03fb829c0c0";
      byte[] payload = Hex.decode(blockRaw);
     
      final int ITERATIONS = 10000000;
      RLPList list = null;
      DecodeResult result = null;
      System.out.println("Starting " + ITERATIONS + " decoding iterations...");
 
      long start1 = System.currentTimeMillis();
      for (int i = 0; i < ITERATIONS; i++) {
        result = RLP.decode(payload, 0);
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.