You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "maxxedev (via GitHub)" <gi...@apache.org> on 2023/04/12 00:36:25 UTC

[GitHub] [commons-io] maxxedev commented on a diff in pull request #447: Add blocking read mode to QueueInputStream.

maxxedev commented on code in PR #447:
URL: https://github.com/apache/commons-io/pull/447#discussion_r1163450815


##########
src/main/java/org/apache/commons/io/input/QueueInputStream.java:
##########
@@ -86,12 +99,24 @@ public QueueOutputStream newQueueOutputStream() {
     }
 
     /**
-     * Reads and returns a single byte.
+     * Reads and returns a single byte. In blocking read mode, the method will wait if necessary until a queue element
+     * becomes available. In non-blocking read mode, the method will return -1 immediately if the queue is empty.
      *
      * @return either the byte read or {@code -1} if the end of the stream has been reached
+     * @throws InterruptedIOException if the thread is interrupted while reading from the queue.
      */
     @Override
-    public int read() {
+    public int read() throws InterruptedIOException {

Review Comment:
   Good point. I created a subclass.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org