Class Utf8RecodingDeferredFileOutputStream

java.lang.Object
org.apache.maven.plugin.surefire.report.Utf8RecodingDeferredFileOutputStream

final class Utf8RecodingDeferredFileOutputStream extends Object
A deferred file output stream decorator that encodes the string from the VM to UTF-8.
The deferred file is temporary file, and it is created at the first write. The reads can be called anytime. It is highly recommended to commit the cache which would close the file stream and subsequent reads may continue. The free() method would commit and delete the deferred file.
  • Field Details

    • NL_BYTES

      private static final byte[] NL_BYTES
    • CACHE_SIZE

      public static final int CACHE_SIZE
      See Also:
    • channel

      private final String channel
    • file

      private Path file
    • storage

      private RandomAccessFile storage
    • closed

      private boolean closed
    • largeCache

      private SoftReference<byte[]> largeCache
    • cache

      private ByteBuffer cache
    • isDirty

      private boolean isDirty
  • Constructor Details

    • Utf8RecodingDeferredFileOutputStream

      Utf8RecodingDeferredFileOutputStream(String channel)
  • Method Details