Skip to content

Using JavaFileObject.openOutputStream is very slow #233

@oehme

Description

@oehme

This method returns an output stream that writes each byte individually, which makes builds very slow. This Javac bug exists all the way up to JDK 15. The FilerOutputStream extends FilterOutputStream without overriding the write(byte[], offset, length) method. I've opened a JDK bug.

In the meantime you can use JavaFileObject.openWriter instead, which does not have this performance problem. You can adapt it back to OutputStream using org.apache.commons.io.output.WriterOutputStream

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions