@@ -171,7 +171,11 @@ public interface Callback {
171
171
* BidirectionalStream#read read()} to start reading data. Consumer may call {@link
172
172
* BidirectionalStream#write write()} to start writing data.
173
173
*
174
- * @param stream the stream that is ready.
174
+ * @param stream the stream that is ready. <strong>This is not guaranteed to be the same
175
+ * object as the one received by other callbacks, nor is it guaranteed to be the one
176
+ * returned by {@link BidirectionalStream.Builder#build}.</strong> However, method
177
+ * calls on this object will have the same effects as calls on the original
178
+ * {@link BidirectionalStream}.
175
179
*/
176
180
void onStreamReady (@ NonNull BidirectionalStream stream );
177
181
@@ -181,7 +185,11 @@ public interface Callback {
181
185
* BidirectionalStream#read read()} to start reading. Consumer may call {@link
182
186
* BidirectionalStream#write write()} to start writing or close the stream.
183
187
*
184
- * @param stream the stream on which response headers were received.
188
+ * @param stream the stream on which response headers were received. <strong>This is not
189
+ * guaranteed to be the same object as the one received by other callbacks, nor is
190
+ * it guaranteed to be the one returned by {@link BidirectionalStream.Builder#build}.
191
+ * </strong> However, method calls on this object will have the same effects as
192
+ * calls on the original {@link BidirectionalStream}.
185
193
* @param info the response information.
186
194
*/
187
195
void onResponseHeadersReceived (@ NonNull BidirectionalStream stream ,
@@ -194,10 +202,13 @@ void onResponseHeadersReceived(@NonNull BidirectionalStream stream,
194
202
* onResponseTrailersReceived()}, if there was pending read data before trailers were
195
203
* received.
196
204
*
197
- * @param stream the stream on which the read completed
205
+ * @param stream the stream on which the read completed. <strong>This is not guaranteed to
206
+ * be the same object as the one received by other callbacks, nor is it guaranteed
207
+ * to be the one returned by {@link BidirectionalStream.Builder#build}.</strong>
208
+ * However, method calls on this object will have the same effects as calls on the
209
+ * original {@link BidirectionalStream}.
198
210
* @param info the response information
199
211
* @param buffer the buffer that was passed to {@link BidirectionalStream#read read()}, now
200
- * containing the received data. The buffer's limit is not changed. The buffer's position is
201
212
* set to the end of the received data. If position is not updated, it means the remote side
202
213
* has signaled that it will send no more data.
203
214
* @param endOfStream if true, this is the last read data, remote will not send more data,
@@ -213,7 +224,11 @@ void onReadCompleted(@NonNull BidirectionalStream stream, @NonNull UrlResponseIn
213
224
* limit is not changed. To continue writing, call {@link BidirectionalStream#write
214
225
* write()}.
215
226
*
216
- * @param stream the stream on which the write completed
227
+ * @param stream the stream on which the write completed. <strong>This is not guaranteed to
228
+ * be the same object as the one received by other callbacks, nor is it guaranteed
229
+ * to be the one returned by {@link BidirectionalStream.Builder#build}.</strong>
230
+ * However, method calls on this object will have the same effects as calls on the
231
+ * original {@link BidirectionalStream}.
217
232
* @param info the response information
218
233
* @param buffer the buffer that was passed to {@link BidirectionalStream#write write()}.
219
234
* The
@@ -231,7 +246,11 @@ void onWriteCompleted(@NonNull BidirectionalStream stream, @NonNull UrlResponseI
231
246
*
232
247
* Default implementation takes no action.
233
248
*
234
- * @param stream the stream on which response trailers were received
249
+ * @param stream the stream on which response trailers were received. <strong>This is not
250
+ * guaranteed to be the same object as the one received by other callbacks, nor is
251
+ * it guaranteed to be the one returned by {@link BidirectionalStream.Builder#build}.
252
+ * </strong> However, method calls on this object will have the same effects as calls
253
+ * on the original {@link BidirectionalStream}.
235
254
* @param info the response information
236
255
* @param trailers the trailers received
237
256
*/
@@ -243,7 +262,11 @@ void onResponseTrailersReceived(@NonNull BidirectionalStream stream,
243
262
* remotely and locally. Once invoked, no further {@link BidirectionalStream.Callback}
244
263
* methods will be invoked.
245
264
*
246
- * @param stream the stream which is closed successfully
265
+ * @param stream the stream which is closed successfully. <strong>This is not guaranteed to
266
+ * be the same object as the one received by other callbacks, nor is it guaranteed
267
+ * to be the one returned by {@link BidirectionalStream.Builder#build}.</strong>
268
+ * However, method calls on this object will have the same effects as calls on the
269
+ * original {@link BidirectionalStream}.
247
270
* @param info the response information
248
271
*/
249
272
void onSucceeded (@ NonNull BidirectionalStream stream , @ NonNull UrlResponseInfo info );
@@ -254,7 +277,11 @@ void onResponseTrailersReceived(@NonNull BidirectionalStream stream,
254
277
* mapped to {@link NetworkException#getErrorCode} codes. Once invoked,
255
278
* no further {@link BidirectionalStream.Callback} methods will be invoked.
256
279
*
257
- * @param stream the stream which has failed
280
+ * @param stream the stream which has failed. <strong>This is not guaranteed to
281
+ * be the same object as the one received by other callbacks, nor is it guaranteed
282
+ * to be the one returned by {@link BidirectionalStream.Builder#build}.</strong>
283
+ * However, method calls on this object will have the same effects as calls on the
284
+ * original {@link BidirectionalStream}.
258
285
* @param info the response information. May be {@code null} if no response was received.
259
286
* @param error information about the failure
260
287
*/
@@ -266,7 +293,11 @@ void onFailed(@NonNull BidirectionalStream stream, @Nullable UrlResponseInfo inf
266
293
* no further {@link BidirectionalStream.Callback} methods will be invoked. Default
267
294
* implementation takes no action.
268
295
*
269
- * @param stream the stream that was canceled
296
+ * @param stream the stream that was canceled. <strong>This is not guaranteed to
297
+ * be the same object as the one received by other callbacks, nor is it guaranteed
298
+ * to be the one returned by {@link BidirectionalStream.Builder#build}.</strong>
299
+ * However, method calls on this object will have the same effects as calls on the
300
+ * original {@link BidirectionalStream}.
270
301
* @param info the response information. May be {@code null} if no response was received.
271
302
*/
272
303
void onCanceled (@ NonNull BidirectionalStream stream , @ Nullable UrlResponseInfo info );
0 commit comments