Skip to content

Commit

Permalink
improve performance
Browse files Browse the repository at this point in the history
  • Loading branch information
VysotskiVadim committed Apr 5, 2023
1 parent 0b3affb commit 96c0c3a
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,7 @@ public static DirectionsResponse fromJson(@NonNull ByteBuffer json, Charset char

InputStream is = new ByteBufferBackedInputStream(json);
InputStreamReader r = new InputStreamReader(is, charsets);
BufferedReader br = new BufferedReader(r);
return gson.create().fromJson(br, DirectionsResponse.class).toBuilder().build();
return gson.create().fromJson(r, DirectionsResponse.class).toBuilder().build();
}

private static class ByteBufferBackedInputStream extends InputStream {
Expand Down

0 comments on commit 96c0c3a

Please sign in to comment.