* PAPI: Get the current outputBuffer from the top of the stack.
* @return The OutputBuffer which is on the top of the stack.
*/
public OutputBuffer getCurrentOutputBuffer() {
OutputBuffer currentOutputBuffer;
OutputBuffer topOutputBuffer;
if (outputBufferStack == null || outputBufferStack.isEmpty()) {
topOutputBuffer = null;
currentOutputBuffer = null;
} else {
topOutputBuffer = (OutputBuffer) outputBufferStack.peek();
// The OutputBuffer on the stack could be a simple one, or a
// compound one. If it is a compound one then we need to return
// its current buffer.
currentOutputBuffer = topOutputBuffer.getCurrentBuffer();
}
if (logger.isDebugEnabled()) {
if (currentOutputBuffer == topOutputBuffer) {
logger.debug("OUTPUT BUFFER STACK: Current " + currentOutputBuffer);