-
Bug
-
Resolution: Fixed
-
P4
-
18
-
b17
PathFileObject.getCharContent reads the input stream into a byte buffer using BaseFileManager.makeByteBuffer. Coding such functionality is not trivial. For example, deciding on whether to read or not, must not solely depend on the result of calling available() on an input stream. To fix this and avoid other possible problems, we could use a method like InputStream.readAllBytes.
One problem with readAllBytes here is that it returns a byte array. This byte array will either need to be wrapped into a new byte buffer or its contents would need to be transferred into an existing byte buffer.
Currently an input stream is manually read in a pooled byte buffer.
One problem with readAllBytes here is that it returns a byte array. This byte array will either need to be wrapped into a new byte buffer or its contents would need to be transferred into an existing byte buffer.
Currently an input stream is manually read in a pooled byte buffer.