Skip to content

Commit

Permalink
No need of okio.BufferedSource
Browse files Browse the repository at this point in the history
response provides a way to get raw bytes now.
  • Loading branch information
tallytalwar committed Dec 18, 2016
1 parent 78055af commit 951eb53
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions android/tangram/src/com/mapzen/tangram/MapController.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import com.mapzen.tangram.TouchInput.Gestures;
import okhttp3.Call;
import okhttp3.Callback;
import okhttp3.Request;
import okhttp3.Response;

import java.io.IOException;
Expand All @@ -21,8 +20,6 @@
import javax.microedition.khronos.egl.EGLConfig;
import javax.microedition.khronos.opengles.GL10;

import okio.BufferedSource;

/**
* {@code MapController} is the main class for interacting with a Tangram map.
*/
Expand Down Expand Up @@ -1007,8 +1004,7 @@ public void onResponse(Call call, Response response) throws IOException {
nativeOnUrlFailure(callbackPtr);
throw new IOException("Unexpected response code: " + response);
}
BufferedSource source = response.body().source();
byte[] bytes = source.readByteArray();
byte[] bytes = response.body().bytes();
nativeOnUrlSuccess(bytes, callbackPtr);
}
});
Expand Down

0 comments on commit 951eb53

Please sign in to comment.