本文整理匯總了Java中retrofit2.http.Streaming類的典型用法代碼示例。如果您正苦於以下問題:Java Streaming類的具體用法?Java Streaming怎麽用?Java Streaming使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
Streaming類屬於retrofit2.http包,在下文中一共展示了Streaming類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: responseBodyConverter
import retrofit2.http.Streaming; //導入依賴的package包/類
@Override
public Converter<ResponseBody, ?> responseBodyConverter(Type type, Annotation[] annotations,
Retrofit retrofit) {
if (type == ResponseBody.class) {
return Utils.isAnnotationPresent(annotations, Streaming.class)
? StreamingResponseBodyConverter.INSTANCE
: BufferingResponseBodyConverter.INSTANCE;
}
if (type == Void.class) {
return VoidResponseBodyConverter.INSTANCE;
}
return null;
}
示例2: executeDownload
import retrofit2.http.Streaming; //導入依賴的package包/類
/**
* 下載文件
* @param url
* @param headerMap
* @param txtParamMap
* @return
*/
@Streaming
@GET
Call<ResponseBody> executeDownload(
@Url String url,
@HeaderMap Map<String, String> headerMap,
@QueryMap Map<String, String> txtParamMap
);
示例3: downloadFile
import retrofit2.http.Streaming; //導入依賴的package包/類
@Streaming
@POST
Call<ResponseBody> downloadFile(@Url String fileUrl);
示例4: responseBodyConverter
import retrofit2.http.Streaming; //導入依賴的package包/類
@Override
public Converter<ResponseBody, ?> responseBodyConverter(Type type, Annotation[] annotations,
Retrofit retrofit) {
if (type == ResponseBody.class) {
if (Utils.isAnnotationPresent(annotations, Streaming.class)) {
return StreamingResponseBodyConverter.INSTANCE;
}
return BufferingResponseBodyConverter.INSTANCE;
}
if (type == Void.class) {
return VoidResponseBodyConverter.INSTANCE;
}
return null;
}
示例5: get
import retrofit2.http.Streaming; //導入依賴的package包/類
@Override
public CallAdapter<?> get(Type returnType, Annotation[] annotations, final Retrofit retrofit) {
if (returnType != Download.Builder.class) {
return null;
}
if (!Util.isAnnotationPresent(annotations, Streaming.class)) {
throw new IllegalArgumentException("Download.Builder requires @Streaming.");
}
return new CallAdapter<Download.Builder>() {
@Override
public Type responseType() {
return ResponseBody.class;
}
@SuppressWarnings("unchecked")
@Override
public <R> Download.Builder adapt(Call<R> call) {
Download.Builder builder = new Download.Builder((Call<ResponseBody>) call);
Executor callbackExecutor = retrofit.callbackExecutor();
if (callbackExecutor != null) {
builder.callbackExecutor(callbackExecutor);
}
return builder;
}
};
}
示例6: downloadFile
import retrofit2.http.Streaming; //導入依賴的package包/類
@Streaming
@GET
Call<ResponseBody> downloadFile(@Url String fileUrl);
示例7: download
import retrofit2.http.Streaming; //導入依賴的package包/類
@GET
@Streaming
Flowable<Response<ResponseBody>> download(@Header("Range") String range,
@Url String url);
示例8: requestFileDataDownload
import retrofit2.http.Streaming; //導入依賴的package包/類
/** download */
@Streaming
@Headers({ "User-Agent: androidProgram" })
@GET("DownloadServlet")
Call<ResponseBody> requestFileDataDownload(@QueryMap Map<String, String> parameters);
示例9: getStreamingStatuses
import retrofit2.http.Streaming; //導入依賴的package包/類
@Streaming
@POST("statuses/filter.json")
Observable<ResponseBody> getStreamingStatuses(@Query("track") String track, @Query("filter_level") String filterLevel);
示例10: download
import retrofit2.http.Streaming; //導入依賴的package包/類
@Streaming/*大文件需要加入這個判斷,防止下載過程中寫入到內存中*/
@GET
Observable<ResponseBody> download(@Header("RANGE") String start, @Url String url);
示例11: download
import retrofit2.http.Streaming; //導入依賴的package包/類
@Streaming
@GET
Call<ResponseBody> download(@Url String url, @HeaderMap Map<String,String> headerMap);
示例12: get
import retrofit2.http.Streaming; //導入依賴的package包/類
@GET("{handle}")
@Streaming
Call<ResponseBody> get(
@Path("handle") String handle,
@Query("policy") String policy,
@Query("signature") String signature);
示例13: transform
import retrofit2.http.Streaming; //導入依賴的package包/類
@Streaming
@GET("{tasks}/{handle}")
Call<ResponseBody> transform(
@Path("tasks") String tasks,
@Path("handle") String handle);
示例14: transformExt
import retrofit2.http.Streaming; //導入依賴的package包/類
@Streaming
@GET("{key}/{tasks}/{url}")
Call<ResponseBody> transformExt(
@Path("key") String key,
@Path("tasks") String tasks,
@Path("url") String url);
示例15: downFile
import retrofit2.http.Streaming; //導入依賴的package包/類
@Streaming
@GET()
Observable<ResponseBody> downFile(@Url() String url, @QueryMap Map<String, String> maps);