Code example for JsonReader

Methods: nextNullpeek

    newFactory(StringBuilder.class, STRING_BUILDER);
  public static final TypeAdapter<StringBuffer> STRING_BUFFER = new TypeAdapter<StringBuffer>() {
    public StringBuffer read(JsonReader in) throws IOException { 
      if (in.peek() == JsonToken.NULL) { 
        return null; 
      return new StringBuffer(in.nextString()); 
    public void write(JsonWriter out, StringBuffer value) throws IOException { 
      out.value(value == null ? null : value.toString()); 
  public static final TypeAdapterFactory STRING_BUFFER_FACTORY =
    newFactory(StringBuffer.class, STRING_BUFFER);
Connect your IDE to all the code out there  Get Codota for Java