public class FileBackedMemoryOutputStream extends OutputStream
OutputStream implementation which writes into a byte[] until a certain threshold is
reached and then starts writing into a File beyond that.| Modifier and Type | Class and Description |
|---|---|
static class |
FileBackedMemoryOutputStream.MemoryUnit |
| Constructor and Description |
|---|
FileBackedMemoryOutputStream(int fileThreshold,
FileBackedMemoryOutputStream.MemoryUnit memoryUnit,
boolean useOffHeapMemory,
File tempDirectory,
String fileName,
String fileExtension) |
| Modifier and Type | Method and Description |
|---|---|
void |
clean() |
void |
close() |
void |
flush() |
InputStream |
openWrittenDataInputStream() |
long |
size() |
void |
write(byte[] b,
int off,
int len) |
void |
write(int b) |
writepublic FileBackedMemoryOutputStream(int fileThreshold,
FileBackedMemoryOutputStream.MemoryUnit memoryUnit,
boolean useOffHeapMemory,
File tempDirectory,
String fileName,
String fileExtension)
public void write(int b)
throws IOException
write in class OutputStreamIOExceptionpublic void write(byte[] b,
int off,
int len)
throws IOException
write in class OutputStreamIOExceptionpublic void flush()
throws IOException
flush in interface Flushableflush in class OutputStreamIOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class OutputStreamIOExceptionpublic long size()
public void clean()
public InputStream openWrittenDataInputStream() throws IOException
IOExceptionCopyright © 2007–2017 The Apache Software Foundation. All rights reserved.