org.eclipse.jgit.util
Class TemporaryBuffer.Heap
java.lang.Object
java.io.OutputStream
org.eclipse.jgit.util.TemporaryBuffer
org.eclipse.jgit.util.TemporaryBuffer.Heap
- All Implemented Interfaces:
- Closeable, Flushable
- Enclosing class:
- TemporaryBuffer
public static class TemporaryBuffer.Heap
- extends TemporaryBuffer
A temporary buffer that will never exceed its in-memory limit.
If the in-memory limit is reached an IOException is thrown, rather than
attempting to spool to local disk.
Constructor Summary |
TemporaryBuffer.Heap(int limit)
Create a new heap buffer with a maximum storage limit. |
Method Summary |
protected OutputStream |
overflow()
Open the overflow output stream, so the remaining output can be stored. |
Methods inherited from class org.eclipse.jgit.util.TemporaryBuffer |
close, copy, destroy, doFlush, length, openInputStream, reset, toByteArray, write, write, writeTo |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TemporaryBuffer.Heap
public TemporaryBuffer.Heap(int limit)
- Create a new heap buffer with a maximum storage limit.
- Parameters:
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.
overflow
protected OutputStream overflow()
throws IOException
- Description copied from class:
TemporaryBuffer
- Open the overflow output stream, so the remaining output can be stored.
- Specified by:
overflow
in class TemporaryBuffer
- Returns:
- the output stream to receive the buffered content, followed by
the remaining output.
- Throws:
IOException
- the buffer cannot create the overflow stream.
Copyright © 2012. All Rights Reserved.