public static class TemporaryBuffer.Heap extends TemporaryBuffer
If the in-memory limit is reached an IOException is thrown, rather than attempting to spool to local disk.
TemporaryBuffer.Block, TemporaryBuffer.Heap, TemporaryBuffer.LocalFile
blocks, DEFAULT_IN_CORE_LIMIT
Constructor and Description |
---|
Heap(int limit)
Create a new heap buffer with a maximum storage limit.
|
Heap(int estimatedSize,
int limit)
Create a new heap buffer with a maximum storage limit.
|
Modifier and Type | Method and Description |
---|---|
protected java.io.OutputStream |
overflow()
Open the overflow output stream, so the remaining output can be stored.
|
close, copy, destroy, doFlush, length, openInputStream, openInputStreamWithAutoDestroy, reset, toByteArray, toByteArray, write, write, writeTo
public Heap(int limit)
limit
- maximum number of bytes that can be stored in this buffer;
also used as the estimated size. Storing beyond this many
will cause an IOException to be thrown during write.public Heap(int estimatedSize, int limit)
estimatedSize
- estimated size of storage used, to size the initial list of
block pointers.limit
- maximum number of bytes that can be stored in this buffer.
Storing beyond this many will cause an IOException to be
thrown during write.protected java.io.OutputStream overflow() throws java.io.IOException
TemporaryBuffer
overflow
in class TemporaryBuffer
java.io.IOException
- the buffer cannot create the overflow stream.