下面列出了com.bumptech.glide.load.HttpException#com.bumptech.glide.util.Preconditions 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
@Override
public void onResponse(@NonNull Call call, @NonNull Response response) {
mResponseBody = response.body();
if (response.isSuccessful()) {
long contentLength = Preconditions.checkNotNull(mResponseBody).contentLength();
mInputStream = ContentLengthInputStream.obtain(mResponseBody.byteStream(), contentLength);
mDataCallback.onDataReady(mInputStream);
} else {
mDataCallback.onLoadFailed(new HttpException(response.message(), response.code()));
}
}
@Override
public void onResponse(@NonNull Call call, @NonNull Response response) {
responseBody = response.body();
if (response.isSuccessful()) {
long contentLength = Preconditions.checkNotNull(responseBody).contentLength();
stream = ContentLengthInputStream.obtain(responseBody.byteStream(), contentLength);
callback.onDataReady(stream);
} else {
callback.onLoadFailed(new HttpException(response.message(), response.code()));
}
}
@Override
public void onResponse(@NonNull Call call, @NonNull Response response) {
responseBody = response.body();
if (response.isSuccessful()) {
long contentLength = Preconditions.checkNotNull(responseBody).contentLength();
stream = ContentLengthInputStream.obtain(responseBody.byteStream(), contentLength);
callback.onDataReady(stream);
} else {
callback.onLoadFailed(new HttpException(response.message(), response.code()));
}
}