/*
(non-Javadoc)
@see com.google.gson.TypeAdapter#read(com.google.gson.stream.JsonReader)
326108
@Override
  public MarkTiming read(JsonReader in) throws IOException {
    if (in.peek() == JsonToken.NULL) {
      in.nextNull();
      return null;
    }

    final MarkTiming markTiming = new MarkTiming();
    in.beginArray();

    if (in.peek() == JsonToken.STRING) {
      markTiming.setMark(in.nextString());
    }
    if (in.peek() == JsonToken.NUMBER) {
      markTiming.setTime(in.nextDouble());
    }

    in.endArray();
    return markTiming;
  }
1362110
@Override
    public void read(final InputStream inputStream) throws ConfigurationException, IOException {
        try (Reader reader = new InputStreamReader(inputStream)) {
            read(reader);
        }
    }
1321346
public int read(final Reader reader) throws IOException {
        final int c = reader.read(cbuf);
        if (c > 0) {
            addData(cbuf, 0, c);
        }
        return c;
    }
496961
protected String readJsonFrom(final InputStream json) throws IOException {
        return isJsonFormat()
            ? JsonValue.readHjson(IOUtils.toString(json, StandardCharsets.UTF_8)).toString()
            : String.join("\n", IOUtils.readLines(json, StandardCharsets.UTF_8));
    }
691952
private Map<String, Object> readObjectArgument(JsonReader jsonReader)
            throws IOException {
        Map<String, Object> arg = new LinkedHashMap<>();
        jsonReader.beginObject();
        while (jsonReader.hasNext()) {
            arg.put(jsonReader.nextName(),
                    JsonParser.GSON.fromJson(jsonReader, Object.class));
        }
        jsonReader.endObject();
        return arg;
    }
183158
protected void initJsonReader() {
		String readerList = config.getJsonReaders();
		if (readerList != null) {
			String[] readers = readerList.split(",");
			Set<String> supportedReaders = TreeReaderRegistry.getReadersByFormat("json");
			TreeReader selectedReader = null;
			for (String reader : readers) {
				reader = reader.trim().toLowerCase();
				if (!reader.isEmpty()) {
					for (String supportedReader : supportedReaders) {
						int i = supportedReader.lastIndexOf('.');
						if (i > -1) {
							supportedReader = supportedReader.substring(i + 1);
						}
						if (supportedReader.toLowerCase().contains(reader)) {
							selectedReader = TreeReaderRegistry.getReader(supportedReader);
							logger.info("Default JSON deserializer/reader is \"" + selectedReader.getClass() + "\".");
							TreeReaderRegistry.setReader("json", selectedReader);
							break;
						}
					}
					if (selectedReader != null) {
						break;
					}
				}
			}
		}
	}
402869
public JsonReader newJsonReader( String input ) {
        JsonReader reader = new NonBufferedJsonReader( input );
        reader.setLenient( true );
        return reader;
    }
353486
@Override
    <T> T read(Class<T> rootType) {
        try {
            try {
                return parseRemaining(rootType);
            } finally {
                input.close();
            }
        } catch (RuntimeException ex) {
            throw ex;
        } catch (Exception ex) {
            throw new RuntimeException(ex);
        }
    }
962106
public int readFrom(InputStream stream) throws IOException {
        int bytesRead = stream.read(buffer);
        if (bytesRead < 0) {
            bytesInBuffer = 0;
        } else {
            bytesInBuffer = bytesRead;
        }
        return bytesRead;
    }
1219986
public static JsonNode readJson(String source, ClassLoader classLoader) {
        return SerializationUtils.readJson(source, classLoader);
    }
1203184
public <T> T read(final InputStream stream, final DataTypeDescriptor<T> descriptor) {
		try {
			return jsonFormat.read(stream, descriptor);
		} catch (Exception e) {
			throw propagate(e);
		}
	}
801186
public static JsonElement parse(JsonReader reader) throws JsonParseException {
    boolean isEmpty = true;
    try {
      reader.peek();
      isEmpty = false;
      return TypeAdapters.JSON_ELEMENT.read(reader);
    } catch (EOFException e) {
      /*
       * For compatibility with JSON 1.5 and earlier, we return a JsonNull for
       * empty documents instead of throwing.
       */
      if (isEmpty) {
        return JsonNull.INSTANCE;
      }
      // The stream ended prematurely so it is likely a syntax error.
      throw new JsonSyntaxException(e);
    } catch (MalformedJsonException e) {
      throw new JsonSyntaxException(e);
    } catch (IOException e) {
      throw new JsonIOException(e);
    } catch (NumberFormatException e) {
      throw new JsonSyntaxException(e);
    }
  }
763243
public final static <T> T readJson(InputStream jsonStream, Class<T> clazz)
    {
        ObjectMapper mapper = new ObjectMapper();
        try
        {
            if (jsonStream != null)
            {
                return mapper.readValue(jsonStream, clazz);
            }
            else
            {
                LOGGER.error("InputStream is null.");
                throw new KunderaException("InputStream is null.");
            }
        }
        catch (IOException e)
        {
            LOGGER.error("Error while mapping input stream to object. Caused By: ", e);
            throw new KunderaException("Error while mapping input stream to object. Caused By: ", e);
        }

    }
621326
public HalResource read(final Reader reader)
    {
        final ContentRepresentation readableRepresentation = representationFactory.readRepresentation(RepresentationFactory.HAL_JSON, reader);

        return new HalResource(objectMapper, readableRepresentation);
    }
927944
public static void read(InputStream stream, byte[] buffer) throws IOException {
        int read = 0;
        while(read < buffer.length) {
            int newlyRead = stream.read(buffer, read, buffer.length - read);
            if(newlyRead == -1)
                throw new EOFException("Attempt to read " + buffer.length
                                       + " bytes failed due to EOF.");
            read += newlyRead;
        }
    }
1368139
@Override
  public Fare read(JsonReader reader) throws IOException {
    if (reader.peek() == JsonToken.NULL) {
      reader.nextNull();
      return null;
    }

    Fare fare = new Fare();
    reader.beginObject();
    while (reader.hasNext()) {
      String key = reader.nextName();
      if ("currency".equals(key)) {
        fare.currency = Currency.getInstance(reader.nextString());
      } else if ("value".equals(key)) {
        // this relies on nextString() being able to coerce raw numbers to strings
        fare.value = new BigDecimal(reader.nextString());
      } else {
        // Be forgiving of unexpected values
        reader.skipValue();
      }
    }
    reader.endObject();

    return fare;
  }
947868
private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException {
        jsonObject = Utils.mapper().readValue((DataInput) stream, ObjectNode.class);
    }