Reads a DBPointer from the stream
@return the json token read
@throws IOException if an I/O error occurs
970579
protected JsonToken handleDBPointer() throws IOException {
		Map<String, Object> pointer = new LinkedHashMap<String, Object>();
		pointer.put("$ns", readString());
		pointer.put("$id", readObjectId());
		getContext().value = pointer;
		return JsonToken.VALUE_EMBEDDED_OBJECT;
	}
646124
public Map<String, Object> parseObject() throws IOException {
		Type t = lexer.readNextToken();
		if (t != Type.START_OBJECT) {
			throw new IOException("Unexpected token: " + t);
		}
		
		return parseObjectInternal();
	}
101658
public int read(BitReader bitreader) throws JSONException {
        try {
            this.width = 0;
            Symbol symbol = this.table;
            while (symbol.integer == none) {
                this.width += 1;
                symbol = bitreader.bit() ? symbol.one : symbol.zero;
            }
            tick(symbol.integer);
            if (JSONzip.probe) {
                JSONzip.logchar(symbol.integer, this.width);
            }
            return symbol.integer;
        } catch (Throwable e) {
            throw new JSONException(e);
        }
    }
589083
public String readType()
        throws IOException
    {
        int code = read();

        if (code != 't') {
            _peek = code;
            return "";
        }

        _isLastChunk = true;
        _chunkLength = (read() << 8) + read();

        _sbuf.setLength(0);
        int ch;
        while ((ch = parseChar()) >= 0)
            _sbuf.append((char) ch);

        return _sbuf.toString();
    }
754246
private void readIdToGrant(CoronaSerializer coronaSerializer)
    throws IOException {
    coronaSerializer.readField("idToGrant");
    // Expecting the START_OBJECT token for idToGrant
    coronaSerializer.readStartObjectToken("idToGrant");
    JsonToken current = coronaSerializer.nextToken();
    while (current != JsonToken.END_OBJECT) {
      Integer id = Integer.parseInt(coronaSerializer.getFieldName());
      ResourceGrant resourceGrant =
        coronaSerializer.readValueAs(ResourceGrant.class);
      idToGrant.put(id, new ResourceGrant(resourceGrant));
      current = coronaSerializer.nextToken();
    }
    // Done with reading the END_OBJECT token for idToGrant
  }
1163510
@Nullable
    public Token next() throws IOException {
        if (unreadToken != null) {
            lastToken = unreadToken;
            unreadToken = null;
            return lastToken;
        }

        while (lastChar >= 0) {
            if (lastChar == 0) {
                if (!readNextChar()) {
                    break;
                }
            }
            if (lastChar == Token.kNewLine ||
                lastChar == Token.kCarriageReturn ||
                lastChar == Token.kSpace ||
                lastChar == Token.kTab) {
                lastChar = 0;
                continue;
            }

            if (lastChar == Token.kShellComment) {
                getRestOfLine();
                continue;
            }

            if (lastChar == Token.kLiteralDoubleQuote || lastChar == Token.kLiteralQuote) {
                lastToken = nextStringLiteral((char) lastChar);
                return lastToken;
            } else if (lastChar == '.' || lastChar == '-' || (lastChar >= '0' && lastChar <= '9')) {
                lastToken = nextNumber();
                return lastToken;
            } else if ('_' == lastChar ||
                       ('a' <= lastChar && lastChar <= 'z') ||
                       ('A' <= lastChar && lastChar <= 'Z')) {
                lastToken = nextToken();
                return lastToken;
            } else if (lastChar < 0x20 || lastChar >= 0x7F) {
                // non-ASCII UTF-8 characters are only allowed inside JSON string literals.
                throw failure(lineNo, linePos, 1, "Unknown token initiator '%s'", Strings.escape((char) lastChar));
            } else {
                lastToken = nextSymbol();
                return lastToken;
            }
        }

        return null;
    }
583942
public static Object parse(Reader reader, JSONVisitor handler)
            throws IOException, ParseException {
        return parse(reader, handler, JSONToken.ANY);
    }
1219986
public static JsonNode readJson(String source, ClassLoader classLoader) {
        return SerializationUtils.readJson(source, classLoader);
    }
853886
public E read() throws IOException {
		boolean status = false;
		try {

			// Read header if not already read
			readHeader();

			// Read the records
			E element;
			try {
				do {
					element = readRecord(this.nextExpectedRecordIndex);
					if (!postRecordReadingStage(element)) {
						element = null;
					}
					++this.nextExpectedRecordIndex;
				}
				while (element == null);
			} catch (EOFException e) {
				element = null;
				close();
				postReadingStage(true);
			}
			status = true;

			return element;
		} finally {
			if (this.taskProgression != null) {
				this.taskProgression.setValue(this.buffer.position() + HEADER_BYTES);
			}
			if (!status) {
				close();
				postReadingStage(status);
			}
		}
	}
581287
public static JSONObjectException fromUnexpectedIOE(IOException src)
    {
        return new JSONObjectException("Unexpected IOException (of type "
                +src.getClass().getName()+"): "+src.getMessage(), (JsonLocation)null, src);
    }
105019
public static final AuthToken fromJSON(String json) {
        try {
            return mapper.reader(AuthToken.class).readValue(json);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
574717
public ReadJSON reader() {
        Object obj = checkNotNull(this.delegate.orNull(), "The delegate object cannot be null");
        checkArgument(obj instanceof String, "The delegate object must be JSON string");
        return new ReadJSON((String) obj, this);
    }
851217
public JsonReader endObject() throws IOException {
      if (currentValue.getKey() != END_OBJECT) {
         throw new IOException("Expecting END_OBJECT, but found " + jsonTokenToStructuredElement(null));
      }
      consume();
      return this;
   }
565078
JsonEvent readEvent() throws IOException {
        char next = readNext();
        // whitespace
        while (next == ' ' || next == '\t' || next == '\n' || next == '\r') {
            next = readNext();
        }
        // identify token
        switch (next) {
            case '{':
                return JsonEvent.OBJECT;
            case '}':
                return JsonEvent.OBJECT_END;
            case '[':
                return JsonEvent.ARRAY;
            case ']':
                return JsonEvent.ARRAY_END;
            case '"':
                return JsonEvent.STRING;
            case '-':
            case '0':
            case '1':
            case '2':
            case '3':
            case '4':
            case '5':
            case '6':
            case '7':
            case '8':
            case '9':
                return acceptNumber(next);
            case 'n':
                return acceptNull();
            case 't':
                return acceptTrue();
            case 'f':
                return acceptFalse();
            case ',':
                return JsonEvent.COMMA;
            case ':':
                return JsonEvent.COLON;
            default:
                throw new IllegalArgumentException("Invalid JSON data: Expected JSON character but found '" + next + "'");
        }
    }
633031
@Override
    public JsonToken nextToken() throws IOException {
        if (nextToken != null) {
            _currToken = nextToken;
            nextToken = null;
            return _currToken;
        }
        // are we to descend to a container child?
        if (startContainer) {
            startContainer = false;
            // minor optimization: empty containers can be skipped
            if (!nodeCursor.currentHasChildren()) {
                _currToken = (_currToken == JsonToken.START_OBJECT) ?
                        JsonToken.END_OBJECT : JsonToken.END_ARRAY;
                return _currToken;
            }
            nodeCursor = nodeCursor.iterateChildren();
            _currToken = nodeCursor.nextToken();
            if (_currToken == JsonToken.START_OBJECT || _currToken == JsonToken.START_ARRAY) {
                startContainer = true;
            }
            return _currToken;
        }
        // No more content?
        if (nodeCursor == null) {
            closed = true; // if not already set
            return null;
        }
        // Otherwise, next entry from currentFieldName cursor
        _currToken = nodeCursor.nextToken();
        if (_currToken != null) {
            if (_currToken == JsonToken.START_OBJECT || _currToken == JsonToken.START_ARRAY) {
                startContainer = true;
            }
            return _currToken;
        }
        // null means no more children; need to return end marker
        _currToken = nodeCursor.endToken();
        nodeCursor = nodeCursor.getParent();
        return _currToken;
    }
165338
@JSFunction
    public String readChar() throws IOException {
        int i = getReader().read();
        if (i == -1)
            return null;
        char[] charArray = { (char) i };
        return new String(charArray);
    }
1296037
public boolean read(DataInputStream daIn, boolean bFixedLength) // Fixed length = false
    {
        ObjectInputStream iStream = null;
        try   {
            iStream = new ObjectInputStream(daIn);
            Object objData = iStream.readObject();
            if (objData instanceof String) if (((String)objData).length() == 0)
                objData = null;
            int errorCode = this.setData(objData, false, DBConstants.READ_MOVE);
            iStream.close();    // Unlink ObjectInputStream
            return (errorCode == DBConstants.NORMAL_RETURN);    // Success
        } catch (IOException ex)    {
            ex.printStackTrace();   // Never
        } catch (ClassNotFoundException ex)   {
            ex.printStackTrace();   // Never
        }
        return false; // Error
    }