Package org.json

Examples of org.json.Kim


                this.kims[integer] = kim;
                this.froms[integer] = from;
                this.thrus[integer] = thru;
                if (JSONzip.probe) {
                    try {
                        JSONzip.log("<<" + integer + " " + new Kim(kim, from, thru) + ">> ");
                    } catch (Throwable ignore) {
                    }
                }
                this.length += 1;
                return integer;
View Full Code Here


            int from = 0;
            int to = 0;
            this.root = new Node();
            while (from < this.capacity) {
                if (this.uses[from] > 1) {
                    Kim kim = this.kims[from];
                    int thru = this.thrus[from];
                    Node node = this.root;
                    for (int at = this.froms[from]; at < thru; at += 1) {
                        Node next = node.vet(kim.get(at));
                        node = next;
                    }
                    node.integer = to;
                    this.uses[to] = age(this.uses[from]);
                    this.froms[to] = this.froms[from];
View Full Code Here

    private void writeName(String name) throws JSONException {

// If this name has already been registered, then emit its integer and
// increment its usage count.

        Kim kim = new Kim(name);
        int integer = this.namekeep.find(kim);
        if (integer != none) {
            one();
            write(integer, this.namekeep);
        } else {
View Full Code Here

        if (string.length() == 0) {
            zero();
            write(end, this.stringhuff);
        } else {
            Kim kim = new Kim(string);

// Look for the string in the strings keep. If it is found, emit its
// integer and count that as a use.

            int integer = this.stringkeep.find(kim);
View Full Code Here

     * @param keep The keep that will receive the kim.
     * @return The string that was read.
     * @throws JSONException
     */
    private String read(Huff huff, Huff ext, Keep keep) throws JSONException {
        Kim kim;
        int at = 0;
        int allocation = 256;
        byte[] bytes = new byte[allocation];
        if (bit()) {
            return getAndTick(keep, this.bitreader).toString();
        }
        while (true) {
            if (at >= allocation) {
                allocation *= 2;
                bytes = java.util.Arrays.copyOf(bytes, allocation);
            }
            int c = huff.read(this.bitreader);
            if (c == end) {
                break;
            }
            while ((c & 128) == 128) {
                bytes[at] = (byte) c;
                at += 1;
                c = ext.read(this.bitreader);
            }
            bytes[at] = (byte) c;
            at += 1;
        }
        if (at == 0) {
            return "";
        }
        kim = new Kim(bytes, at);
        keep.register(kim);
        return kim.toString();
    }
View Full Code Here

TOP

Related Classes of org.json.Kim

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.