public class InMemoryStreamBuffer extends AbstractInputStreamBuffer
AbstractInputStreamBuffer which holds the buffered
information in memory.
If the buffer does not have enough capacity to hold all the data, then it will
expanded up to a certain threshold configured in the constructor. Once that threshold
is reached, a StreamingBufferSizeExceededException will be thrown. If no threshold
is provided, then the buffer will be allowed to grow indefinitely.
AbstractStreamingBuffer.LockReleaserbuffer, bufferManagerclosed, readLock, writeLock| Constructor and Description |
|---|
InMemoryStreamBuffer(InputStream stream,
InMemoryCursorStreamConfig config,
ByteBufferManager bufferManager)
Creates a new instance
|
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
canDoSoftCopy() |
int |
consumeForwardData()
Consumes the stream in order to obtain data that has not been read yet.
|
void |
doClose()
Template method to support the
AbstractInputStreamBuffer.close() operation |
protected ByteBuffer |
doGet(long position,
int length) |
close, consume, consumeStream, copy, deallocate, get, getBuffer, isStreamFullyConsumed, openStreamChannel, streamFullyConsumedcheckNotClosed, closeSafely, withReadLock, withWriteLockpublic InMemoryStreamBuffer(InputStream stream, InMemoryCursorStreamConfig config, ByteBufferManager bufferManager)
stream - the stream to be bufferedconfig - this buffer's configuration.protected ByteBuffer doGet(long position, int length)
doGet in class AbstractInputStreamBufferpublic void doClose()
AbstractInputStreamBuffer.close() operationdoClose in class AbstractInputStreamBufferpublic int consumeForwardData()
throws IOException
buffer doesn't have any remaining capacity, then expandBuffer()
is invoked before attempting to consume new information.consumeForwardData in class AbstractInputStreamBufferorg.mule.runtime.api.streaming.exception.StreamingBufferSizeExceededException - if the buffer is not big enough and cannot be expandedIOExceptionprotected boolean canDoSoftCopy()
canDoSoftCopy in class AbstractInputStreamBufferCopyright © 2003–2017 MuleSoft, Inc.. All rights reserved.