public class MemoryAppender extends StreamAppender
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_BUFFER_SIZE
Default size of memory-buffer (100k).
|
log, outStr
Constructor and Description |
---|
MemoryAppender()
Create a MemoryAppender whose buffer is initially set to 100k.
|
MemoryAppender(int initSize)
Create a MemoryAppender whose buffer has the given initial size.
|
Modifier and Type | Method and Description |
---|---|
byte[] |
getBuffer()
Returns the current buffer.
|
java.io.Reader |
getReader()
Returns a reader that may be used to access the current buffer.
|
void |
print()
Writes the entire buffer to stdout.
|
void |
print(java.io.PrintStream stream)
Writes the entire buffer to the given writer.
|
java.lang.String |
toString() |
close, log, log
public static final int DEFAULT_BUFFER_SIZE
public MemoryAppender(int initSize)
size
- Initial size of buffer.public MemoryAppender()
public byte[] getBuffer()
public java.io.Reader getReader()
public java.lang.String toString()
toString
in class java.lang.Object
public void print(java.io.PrintStream stream)
writer
- Writer to write to.public void print()
Copyright © 2001-2014 Enterprise Distributed Technologies Ltd. All Rights Reserved.