|
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||
java.lang.Object
|
+--java.io.OutputStream
|
+--intradoc.common.TruncatedOutputStream
Specialized output stream used to retain a fixed number of lines in a buffer.
| Field Summary | |
protected byte[] |
m_buffer
The buffer where data is stored. |
protected int |
m_count
The number of valid bytes in the buffer. |
protected int |
m_lineCount
The number of lines in the buffer |
protected int |
m_maxLineCount
The fixed line length of the buffer. |
| Constructor Summary | |
TruncatedOutputStream()
Creates a new TruncatedOutputStream. |
|
TruncatedOutputStream(int lines)
Creates a new TruncatedOutputStream, with a fixed length of the specified size, in bytes. |
|
| Method Summary | |
protected void |
countLines(byte[] b,
int off,
int len)
Returns the number of lines in the data buffer. |
protected void |
removeExcessLines()
Removes characters from the beginning of the buffer to the n-th newline character, determined by the number passed. |
void |
reset()
Resets the count field of this byte array output stream to zero, so that all currently accumulated output in the ouput stream is discarded. |
boolean |
setMaxLines(int lines)
Sets the maxLineCount to the number of lines passed. |
int |
size()
Returns the current size of the buffer. |
java.lang.String |
toString()
Converts the buffer's contents into a string. |
void |
write(byte[] b,
int off,
int len)
Writes len bytes from the specified byte array, starting at offset off, to the end of this TruncatedOutputStream. |
void |
write(int b)
Writes the specified byte to this TruncatedOutputStream. |
| Methods inherited from class java.io.OutputStream |
close, flush, write |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected byte[] m_buffer
protected int m_count
protected int m_lineCount
protected int m_maxLineCount
| Constructor Detail |
public TruncatedOutputStream()
public TruncatedOutputStream(int lines)
lines - The maximum number of lines in the buffer.| Method Detail |
public boolean setMaxLines(int lines)
lines - The maximum number of lines in the buffer.public void write(int b)
write in class java.io.OutputStreamb - the byte to be written.
public void write(byte[] b,
int off,
int len)
write in class java.io.OutputStreamb - the data.off - the start offset in the data.len - the number of bytes to write.
protected void countLines(byte[] b,
int off,
int len)
b - the data.off - the start offset in the data.len - the number of bytes to check.protected void removeExcessLines()
public int size()
public java.lang.String toString()
toString in class java.lang.Objectpublic void reset()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
(c) 1996-2005 All rights reserved. Stellent, Inc. |