Class Utf8RecodingDeferredFileOutputStream
java.lang.Object
org.apache.maven.plugin.surefire.report.Utf8RecodingDeferredFileOutputStream
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
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 Summary
FieldsModifier and TypeFieldDescriptionprivate ByteBuffer
static final int
private final String
private boolean
private Path
private boolean
private SoftReference<byte[]>
private static final byte[]
private RandomAccessFile
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
commit()
void
free()
long
private byte[]
getLargeCache
(int minLength) private void
sync()
void
void
writeTo
(OutputStream out)
-
Field Details
-
NL_BYTES
private static final byte[] NL_BYTES -
CACHE_SIZE
public static final int CACHE_SIZE- See Also:
-
channel
-
file
-
storage
-
closed
private boolean closed -
largeCache
-
cache
-
isDirty
private boolean isDirty
-
-
Constructor Details
-
Utf8RecodingDeferredFileOutputStream
Utf8RecodingDeferredFileOutputStream(String channel)
-
-
Method Details
-
write
- Throws:
IOException
-
getByteCount
public long getByteCount() -
writeTo
- Throws:
IOException
-
commit
public void commit() -
free
public void free() -
sync
- Throws:
IOException
-
getLargeCache
private byte[] getLargeCache(int minLength)
-