org.apache.sling.engine.impl.output
Interface Buffer

All Known Implementing Classes:
BufferedPrintWriter, BufferedServletOutputStream

public interface Buffer

The Buffer interface defines an API, which will be implemented by buffering output channel implementations to facilitate stack management regardless of whether the channel is stream or writer based.


Method Summary
 void flushBuffer()
          Flushes the current contents of the buffer to the output destination without forcing the destination to flush its contents.
 int getBufferSize()
          Returns the current size of the buffer.
 void resetBuffer()
          Removes the contents of the buffer.
 void setBufferSize(int buffersize)
          Sets the new size of the buffer.
 

Method Detail

setBufferSize

void setBufferSize(int buffersize)
Sets the new size of the buffer.

Parameters:
buffersize - The new size of the buffer. The interpretation of negative or zero values is up to the implementation.
Throws:
IllegalStateException - may be thrown if the implementation may not currently change the size of the buffer.

getBufferSize

int getBufferSize()
Returns the current size of the buffer. If the implementation is not currently buffering or does not support buffering at a negative number must be returned.

Returns:
The current size of the buffer or a negative number if buffering is disabled or not supported by the implementation.

flushBuffer

void flushBuffer()
                 throws IOException
Flushes the current contents of the buffer to the output destination without forcing the destination to flush its contents.

Throws:
IOException - May be thrown if an error occurrs flushing the contents of the buffer.

resetBuffer

void resetBuffer()
Removes the contents of the buffer.

Throws:
IllegalStateException - may be thrown if the implementation is not willing to clear the buffer.


Copyright © 2007-2013 The Apache Software Foundation. All Rights Reserved.