Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8277501

Revisit PathFileObject.getCharContent and friends

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 21
    • 18
    • tools
    • 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.

            prappo Pavel Rappo (Inactive)
            prappo Pavel Rappo (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: