25
25
import io .reactivex .Observable ;
26
26
import io .reactivex .Single ;
27
27
import io .reactivex .functions .Function ;
28
+ import java .nio .ByteBuffer ;
28
29
29
30
/**
30
31
* An instance of this class provides access to all the operations defined in
@@ -60,17 +61,17 @@ interface FilesService {
60
61
@ GET ("files/stream/nonempty" )
61
62
@ ExpectedResponses ({200 })
62
63
@ UnexpectedResponseExceptionType (ErrorException .class )
63
- Single <RestResponse <Void , Flowable <byte [] >>> getFile ();
64
+ Single <RestResponse <Void , Flowable <ByteBuffer >>> getFile ();
64
65
65
66
@ GET ("files/stream/verylarge" )
66
67
@ ExpectedResponses ({200 })
67
68
@ UnexpectedResponseExceptionType (ErrorException .class )
68
- Single <RestResponse <Void , Flowable <byte [] >>> getFileLarge ();
69
+ Single <RestResponse <Void , Flowable <ByteBuffer >>> getFileLarge ();
69
70
70
71
@ GET ("files/stream/empty" )
71
72
@ ExpectedResponses ({200 })
72
73
@ UnexpectedResponseExceptionType (ErrorException .class )
73
- Single <RestResponse <Void , Flowable <byte [] >>> getEmptyFile ();
74
+ Single <RestResponse <Void , Flowable <ByteBuffer >>> getEmptyFile ();
74
75
}
75
76
76
77
/**
@@ -79,9 +80,9 @@ interface FilesService {
79
80
* @throws IllegalArgumentException thrown if parameters fail the validation.
80
81
* @throws ErrorException thrown if the request is rejected by server.
81
82
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
82
- * @return the Flowable<byte[] > object if successful.
83
+ * @return the Flowable<ByteBuffer > object if successful.
83
84
*/
84
- public Flowable <byte [] > getFile () {
85
+ public Flowable <ByteBuffer > getFile () {
85
86
return getFileAsync ().blockingGet ();
86
87
}
87
88
@@ -90,32 +91,32 @@ public Flowable<byte[]> getFile() {
90
91
*
91
92
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
92
93
* @throws IllegalArgumentException thrown if parameters fail the validation.
93
- * @return the {@link ServiceFuture<Flowable<byte[] >>} object.
94
+ * @return the {@link ServiceFuture<Flowable<ByteBuffer >>} object.
94
95
*/
95
- public ServiceFuture <Flowable <byte [] >> getFileAsync (final ServiceCallback <Flowable <byte [] >> serviceCallback ) {
96
+ public ServiceFuture <Flowable <ByteBuffer >> getFileAsync (final ServiceCallback <Flowable <ByteBuffer >> serviceCallback ) {
96
97
return ServiceFuture .fromBody (getFileAsync (), serviceCallback );
97
98
}
98
99
99
100
/**
100
101
* Get file.
101
102
*
102
103
* @throws IllegalArgumentException thrown if parameters fail the validation.
103
- * @return the {@link Single<RestResponse<Void, Flowable<byte[] >>>} object if successful.
104
+ * @return the {@link Single<RestResponse<Void, Flowable<ByteBuffer >>>} object if successful.
104
105
*/
105
- public Single <RestResponse <Void , Flowable <byte [] >>> getFileWithRestResponseAsync () {
106
+ public Single <RestResponse <Void , Flowable <ByteBuffer >>> getFileWithRestResponseAsync () {
106
107
return service .getFile ();
107
108
}
108
109
109
110
/**
110
111
* Get file.
111
112
*
112
113
* @throws IllegalArgumentException thrown if parameters fail the validation.
113
- * @return the {@link Maybe<Flowable<byte[] >>} object if successful.
114
+ * @return the {@link Maybe<Flowable<ByteBuffer >>} object if successful.
114
115
*/
115
- public Maybe <Flowable <byte [] >> getFileAsync () {
116
+ public Maybe <Flowable <ByteBuffer >> getFileAsync () {
116
117
return getFileWithRestResponseAsync ()
117
- .flatMapMaybe (new Function <RestResponse <Void , Flowable <byte [] >>, Maybe <Flowable <byte [] >>>() {
118
- public Maybe <Flowable <byte [] >> apply (RestResponse <Void , Flowable <byte [] >> restResponse ) {
118
+ .flatMapMaybe (new Function <RestResponse <Void , Flowable <ByteBuffer >>, Maybe <Flowable <ByteBuffer >>>() {
119
+ public Maybe <Flowable <ByteBuffer >> apply (RestResponse <Void , Flowable <ByteBuffer >> restResponse ) {
119
120
if (restResponse .body () == null ) {
120
121
return Maybe .empty ();
121
122
} else {
@@ -131,9 +132,9 @@ public Maybe<Flowable<byte[]>> apply(RestResponse<Void, Flowable<byte[]>> restRe
131
132
* @throws IllegalArgumentException thrown if parameters fail the validation.
132
133
* @throws ErrorException thrown if the request is rejected by server.
133
134
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
134
- * @return the Flowable<byte[] > object if successful.
135
+ * @return the Flowable<ByteBuffer > object if successful.
135
136
*/
136
- public Flowable <byte [] > getFileLarge () {
137
+ public Flowable <ByteBuffer > getFileLarge () {
137
138
return getFileLargeAsync ().blockingGet ();
138
139
}
139
140
@@ -142,32 +143,32 @@ public Flowable<byte[]> getFileLarge() {
142
143
*
143
144
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
144
145
* @throws IllegalArgumentException thrown if parameters fail the validation.
145
- * @return the {@link ServiceFuture<Flowable<byte[] >>} object.
146
+ * @return the {@link ServiceFuture<Flowable<ByteBuffer >>} object.
146
147
*/
147
- public ServiceFuture <Flowable <byte [] >> getFileLargeAsync (final ServiceCallback <Flowable <byte [] >> serviceCallback ) {
148
+ public ServiceFuture <Flowable <ByteBuffer >> getFileLargeAsync (final ServiceCallback <Flowable <ByteBuffer >> serviceCallback ) {
148
149
return ServiceFuture .fromBody (getFileLargeAsync (), serviceCallback );
149
150
}
150
151
151
152
/**
152
153
* Get a large file.
153
154
*
154
155
* @throws IllegalArgumentException thrown if parameters fail the validation.
155
- * @return the {@link Single<RestResponse<Void, Flowable<byte[] >>>} object if successful.
156
+ * @return the {@link Single<RestResponse<Void, Flowable<ByteBuffer >>>} object if successful.
156
157
*/
157
- public Single <RestResponse <Void , Flowable <byte [] >>> getFileLargeWithRestResponseAsync () {
158
+ public Single <RestResponse <Void , Flowable <ByteBuffer >>> getFileLargeWithRestResponseAsync () {
158
159
return service .getFileLarge ();
159
160
}
160
161
161
162
/**
162
163
* Get a large file.
163
164
*
164
165
* @throws IllegalArgumentException thrown if parameters fail the validation.
165
- * @return the {@link Maybe<Flowable<byte[] >>} object if successful.
166
+ * @return the {@link Maybe<Flowable<ByteBuffer >>} object if successful.
166
167
*/
167
- public Maybe <Flowable <byte [] >> getFileLargeAsync () {
168
+ public Maybe <Flowable <ByteBuffer >> getFileLargeAsync () {
168
169
return getFileLargeWithRestResponseAsync ()
169
- .flatMapMaybe (new Function <RestResponse <Void , Flowable <byte [] >>, Maybe <Flowable <byte [] >>>() {
170
- public Maybe <Flowable <byte [] >> apply (RestResponse <Void , Flowable <byte [] >> restResponse ) {
170
+ .flatMapMaybe (new Function <RestResponse <Void , Flowable <ByteBuffer >>, Maybe <Flowable <ByteBuffer >>>() {
171
+ public Maybe <Flowable <ByteBuffer >> apply (RestResponse <Void , Flowable <ByteBuffer >> restResponse ) {
171
172
if (restResponse .body () == null ) {
172
173
return Maybe .empty ();
173
174
} else {
@@ -183,9 +184,9 @@ public Maybe<Flowable<byte[]>> apply(RestResponse<Void, Flowable<byte[]>> restRe
183
184
* @throws IllegalArgumentException thrown if parameters fail the validation.
184
185
* @throws ErrorException thrown if the request is rejected by server.
185
186
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
186
- * @return the Flowable<byte[] > object if successful.
187
+ * @return the Flowable<ByteBuffer > object if successful.
187
188
*/
188
- public Flowable <byte [] > getEmptyFile () {
189
+ public Flowable <ByteBuffer > getEmptyFile () {
189
190
return getEmptyFileAsync ().blockingGet ();
190
191
}
191
192
@@ -194,32 +195,32 @@ public Flowable<byte[]> getEmptyFile() {
194
195
*
195
196
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
196
197
* @throws IllegalArgumentException thrown if parameters fail the validation.
197
- * @return the {@link ServiceFuture<Flowable<byte[] >>} object.
198
+ * @return the {@link ServiceFuture<Flowable<ByteBuffer >>} object.
198
199
*/
199
- public ServiceFuture <Flowable <byte [] >> getEmptyFileAsync (final ServiceCallback <Flowable <byte [] >> serviceCallback ) {
200
+ public ServiceFuture <Flowable <ByteBuffer >> getEmptyFileAsync (final ServiceCallback <Flowable <ByteBuffer >> serviceCallback ) {
200
201
return ServiceFuture .fromBody (getEmptyFileAsync (), serviceCallback );
201
202
}
202
203
203
204
/**
204
205
* Get empty file.
205
206
*
206
207
* @throws IllegalArgumentException thrown if parameters fail the validation.
207
- * @return the {@link Single<RestResponse<Void, Flowable<byte[] >>>} object if successful.
208
+ * @return the {@link Single<RestResponse<Void, Flowable<ByteBuffer >>>} object if successful.
208
209
*/
209
- public Single <RestResponse <Void , Flowable <byte [] >>> getEmptyFileWithRestResponseAsync () {
210
+ public Single <RestResponse <Void , Flowable <ByteBuffer >>> getEmptyFileWithRestResponseAsync () {
210
211
return service .getEmptyFile ();
211
212
}
212
213
213
214
/**
214
215
* Get empty file.
215
216
*
216
217
* @throws IllegalArgumentException thrown if parameters fail the validation.
217
- * @return the {@link Maybe<Flowable<byte[] >>} object if successful.
218
+ * @return the {@link Maybe<Flowable<ByteBuffer >>} object if successful.
218
219
*/
219
- public Maybe <Flowable <byte [] >> getEmptyFileAsync () {
220
+ public Maybe <Flowable <ByteBuffer >> getEmptyFileAsync () {
220
221
return getEmptyFileWithRestResponseAsync ()
221
- .flatMapMaybe (new Function <RestResponse <Void , Flowable <byte [] >>, Maybe <Flowable <byte [] >>>() {
222
- public Maybe <Flowable <byte [] >> apply (RestResponse <Void , Flowable <byte [] >> restResponse ) {
222
+ .flatMapMaybe (new Function <RestResponse <Void , Flowable <ByteBuffer >>, Maybe <Flowable <ByteBuffer >>>() {
223
+ public Maybe <Flowable <ByteBuffer >> apply (RestResponse <Void , Flowable <ByteBuffer >> restResponse ) {
223
224
if (restResponse .body () == null ) {
224
225
return Maybe .empty ();
225
226
} else {
0 commit comments