[GitHub] [commons-io] Marcono1234 commented on a change in pull request #291: Improve `ReaderInputStream` documentation

2022-02-07 Thread GitBox


Marcono1234 commented on a change in pull request #291:
URL: https://github.com/apache/commons-io/pull/291#discussion_r800451592



##
File path: src/main/java/org/apache/commons/io/input/ReaderInputStream.java
##
@@ -213,6 +230,16 @@ public void close() throws IOException {
 reader.close();
 }
 
+/**
+ * The implementation by {@link ReaderInputStream} always returns 0.
+ */
+@Override
+public int available() throws IOException {
+// Could implement this using Reader.ready(), but would be rather 
cumbersome
+// and probably not very efficient
+return 0;
+}
+

Review comment:
   Sorry; have removed this method again now in the latest commit.




-- 
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-unsubscr...@commons.apache.org

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




[GitHub] [commons-io] Marcono1234 commented on a change in pull request #291: Improve `ReaderInputStream` documentation

2022-01-05 Thread GitBox


Marcono1234 commented on a change in pull request #291:
URL: https://github.com/apache/commons-io/pull/291#discussion_r779232136



##
File path: src/main/java/org/apache/commons/io/input/ReaderInputStream.java
##
@@ -129,6 +128,9 @@ public ReaderInputStream(final Reader reader) {
  * Constructs a new {@link ReaderInputStream} with a default input buffer 
size of {@value #DEFAULT_BUFFER_SIZE}
  * characters.
  *
+ * The encoder created for the specified charset will use {@link 
CodingErrorAction#REPLACE} for malformed input
+ * and unmappable characters.
+ *

Review comment:
   Have also moved the `` on a separate line to match the style used 
above for the class documentation.




-- 
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-unsubscr...@commons.apache.org

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




[GitHub] [commons-io] Marcono1234 commented on a change in pull request #291: Improve `ReaderInputStream` documentation

2021-11-12 Thread GitBox


Marcono1234 commented on a change in pull request #291:
URL: https://github.com/apache/commons-io/pull/291#discussion_r748648571



##
File path: src/main/java/org/apache/commons/io/input/ReaderInputStream.java
##
@@ -213,6 +230,16 @@ public void close() throws IOException {
 reader.close();
 }
 
+/**
+ * The implementation by {@link ReaderInputStream} always returns 0.
+ */
+@Override
+public int available() throws IOException {
+// Could implement this using Reader.ready(), but would be rather 
cumbersome
+// and probably not very efficient
+return 0;
+}
+

Review comment:
   This class directly extends `InputStream` and the 
[`InputStream.available()` 
documentation](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/io/InputStream.html#available())
 says:
   > The available method of InputStream always returns 0.
   
   I could have used `return super.available();` instead, but then it would be 
less obvious to the reader why the documentation of this method here says that 
it always returns 0 but calls `super.available()`. So I wanted to avoid 
requiring them to look up the super implementation to verify that this method 
behaves correctly.




-- 
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-unsubscr...@commons.apache.org

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