Skip to content

Commit

Permalink
Merge pull request #379 from square/jwilson/new_cache_api
Browse files Browse the repository at this point in the history
Use Request and Response types in OkResponseCache.
  • Loading branch information
JakeWharton committed Dec 30, 2013
2 parents f2d3e0f + 30ecba8 commit 63a278d
Show file tree
Hide file tree
Showing 20 changed files with 435 additions and 542 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package com.squareup.okhttp.internal;

import java.io.ByteArrayInputStream;
import java.io.Closeable;
import java.io.EOFException;
import java.io.File;
Expand Down Expand Up @@ -44,9 +45,7 @@
public final class Util {
public static final byte[] EMPTY_BYTE_ARRAY = new byte[0];
public static final String[] EMPTY_STRING_ARRAY = new String[0];

/** A cheap and type-safe constant for the ISO-8859-1 Charset. */
public static final Charset ISO_8859_1 = Charset.forName("ISO-8859-1");
public static final InputStream EMPTY_INPUT_STREAM = new ByteArrayInputStream(EMPTY_BYTE_ARRAY);

/** A cheap and type-safe constant for the US-ASCII Charset. */
public static final Charset US_ASCII = Charset.forName("US-ASCII");
Expand Down
2 changes: 1 addition & 1 deletion okhttp/src/main/java/com/squareup/okhttp/Dispatcher.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ static class RealResponseBody extends Response.Body {
return responseHeaders.getContentLength();
}

@Override public InputStream byteStream() throws IOException {
@Override public InputStream byteStream() {
return in;
}
}
Expand Down
2 changes: 1 addition & 1 deletion okhttp/src/main/java/com/squareup/okhttp/Failure.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* <h3>Warning: Experimental OkHttp 2.0 API</h3>
* This class is in beta. APIs are subject to change!
*/
/* OkHttp 2.0: public */ class Failure {
public final class Failure {
private final Request request;
private final Throwable exception;

Expand Down
Loading

0 comments on commit 63a278d

Please sign in to comment.