Skip to content

Commit

Permalink
Merge pull request #21 from square/jwilson/fast
Browse files Browse the repository at this point in the history
Merge: Improve HttpResponseCache performance.
  • Loading branch information
JakeWharton committed Sep 19, 2012
2 parents 19d8cf1 + ac21c32 commit 729e930
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/main/java/libcore/net/http/HttpResponseCache.java
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,13 @@ public CacheRequestImpl(final DiskLruCache.Editor editor) throws IOException {
super.close();
editor.commit();
}

@Override
public void write(byte[] buffer, int offset, int length) throws IOException {
// Since we don't override "write(int oneByte)", we can write directly to "out"
// and avoid the inefficient implementation from the FilterOutputStream.
out.write(buffer, offset, length);
}
};
}

Expand Down

0 comments on commit 729e930

Please sign in to comment.