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) |
write
public FileBackedMemoryOutputStream(int fileThreshold, FileBackedMemoryOutputStream.MemoryUnit memoryUnit, boolean useOffHeapMemory, File tempDirectory, String fileName, String fileExtension)
public void write(int b) throws IOException
write
in class OutputStream
IOException
public void write(byte[] b, int off, int len) throws IOException
write
in class OutputStream
IOException
public void flush() throws IOException
flush
in interface Flushable
flush
in class OutputStream
IOException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class OutputStream
IOException
public long size()
public void clean()
public InputStream openWrittenDataInputStream() throws IOException
IOException
Copyright © 2007–2018 The Apache Software Foundation. All rights reserved.