Skip to content

Commit ddd9b88

Browse files
committed
Improve input/output stream documentation
1 parent 8e8a5d8 commit ddd9b88

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

java-does-usb/src/main/java/net/codecrete/usb/USBDevice.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,13 @@ public interface USBDevice {
280280
* Opens a new output stream to send data to a bulk endpoint.
281281
* <p>
282282
* All data written to this output stream is sent to the specified bulk endpoint.
283+
* Buffering and concurrent IO requests are used to achieve a high throughput.
284+
* </p>
285+
* <p>
286+
* The stream will insert zero-length packets if {@link OutputStream#flush()} is called
287+
* and the last packet size was equal to maximum packet size of the endpoint.
288+
* </p>
289+
* <p>
283290
* If {@link #transferOut(int, byte[])} and a output stream or multiple output streams
284291
* are used concurrently for the same endpoint, the behavior is unpredictable.
285292
* </p>
@@ -293,8 +300,10 @@ public interface USBDevice {
293300
* Opens a new input stream to receive data from a bulk endpoint.
294301
* <p>
295302
* All data received from the specified bulk endpoint can be read using this input stream.
303+
* Buffering and concurrent IO requests are used to achieve a high throughput.
296304
* </p>
297305
* <p>
306+
* If the buffers contain data when the stream is closed, this data will be discarded.
298307
* If {@link #transferIn(int)} and an input stream or multiple input streams
299308
* are used concurrently for the same endpoint, the behavior is unpredictable.
300309
* </p>

0 commit comments

Comments
 (0)