本文整理汇总了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);