|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.io.OutputStream java.io.ByteArrayOutputStream org.opengts.util.CachedLogOutputStream
public class CachedLogOutputStream
Cached Logging text OutputStream
Field Summary | |
---|---|
static int |
DEFAULT_MAXIMUM_LENGTH
|
static int |
DEFAULT_MINIMUM_LENGTH
|
Fields inherited from class java.io.ByteArrayOutputStream |
---|
buf, count |
Constructor Summary | |
---|---|
CachedLogOutputStream()
|
|
CachedLogOutputStream(int minSize,
int maxSize)
|
Method Summary | |
---|---|
protected java.lang.String |
_readLine(boolean removeLine)
Reads, and optionally removes, a line of text from the byte array. |
long |
getDiscardID()
Returns the discard-ID. |
static void |
main(java.lang.String[] argv)
|
java.lang.String |
peekLine()
Reads a line of text from the byte array (line is not removed) |
java.lang.String |
readLine()
Reads and removes a line of text from the byte array. |
void |
reset()
Clears/reset the logging text in this cache. |
int |
size()
Gets the current size of the buffer |
void |
write(byte[] b,
int ofs,
int len)
Writes len bytes from the specified byte array
starting at offset off to this byte array output stream. |
void |
write(int b)
Writes the specified byte to this byte array output stream. |
void |
write(java.lang.String s)
Writes the specified String to this byte array output stream. |
void |
writeln(java.lang.String s)
Writes the specified String to this byte array output stream. |
Methods inherited from class java.io.ByteArrayOutputStream |
---|
close, toByteArray, toString, toString, toString, writeTo |
Methods inherited from class java.io.OutputStream |
---|
flush, write |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int DEFAULT_MINIMUM_LENGTH
public static final int DEFAULT_MAXIMUM_LENGTH
Constructor Detail |
---|
public CachedLogOutputStream()
public CachedLogOutputStream(int minSize, int maxSize)
Method Detail |
---|
public void reset()
reset
in class java.io.ByteArrayOutputStream
public int size()
size
in class java.io.ByteArrayOutputStream
public long getDiscardID()
readLine
), if this discard-ID changes,
it means that there was some logging data lost due to the buffer
having been filled, and old logging data discarded.
public void write(int b)
write
in class java.io.ByteArrayOutputStream
b
- the byte to be written.public void write(byte[] b, int ofs, int len)
len
bytes from the specified byte array
starting at offset off
to this byte array output stream.
write
in class java.io.ByteArrayOutputStream
b
- the data.ofs
- the start offset in the data.len
- the number of bytes to write.public void write(java.lang.String s)
s
- the String to be written.public void writeln(java.lang.String s)
s
- the String to be written.protected java.lang.String _readLine(boolean removeLine)
removeLine
- True to remove the line which has been read.
public java.lang.String readLine()
public java.lang.String peekLine()
public static void main(java.lang.String[] argv)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |