|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Object | +--com.ls.util.io.BufferedOutputSource
The OutputSource class writes byte wise data into a buffer. If the buffer is full the data is appended to a StringBuffer. This is done due to performance reasons.
| Field Summary | |
protected byte[] |
buffer
byte array to write the bytes in. |
protected int |
bufferIndex
the index of the byte array buffer |
protected int |
index
the index of the output source |
| Constructor Summary | |
BufferedOutputSource()
Constructor with no additional method calls. |
|
| Method Summary | |
protected void |
fillStringBuffer()
fills the internal StringBuffer with the bytes from the byte array ('internal cache' buffer to speed up the performance) |
byte[] |
getBuffer()
gets the 'internal cache' ( buffer) of this BufferedOutputSource object |
int |
getBufferIndex()
gets the index of the 'internal cache' ( bufferIndex) |
int |
getIndex()
gets the index of this BufferedOutputSource object |
StringBuffer |
getStringBuffer()
returns the complete content of this BufferedOutputSource object. |
void |
reset()
resets this BufferedOutputSource object (empties all buffers) |
String |
toString()
returns the complete content of this BufferedOutputSource object. |
void |
writeByte(byte byteToAdd)
writes the given byte into this BufferedOutputSource instance |
void |
writeByte(char charToAdd)
writes the given char into this BufferedOutputSource instance |
void |
writeSource(BufferedOutputSource outputSource)
writes the content of the given BufferedOutputSource object into this BufferedOutputSource instance |
void |
writeString(String string)
writes the content of the given String into this BufferedOutputSource instance |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected byte[] buffer
protected int bufferIndex
bufferprotected int index
| Constructor Detail |
public BufferedOutputSource()
| Method Detail |
protected void fillStringBuffer()
buffer to speed up the performance)public void writeSource(BufferedOutputSource outputSource)
outputSource - This is the BufferedOutputSource object whose content is added to this BufferedOutputSource instancepublic void writeString(String string)
string - which is added to this BufferedOutputSource instancepublic void writeByte(char charToAdd)
charToAdd - is the character which is added to this BufferedOutputSource instancepublic void writeByte(byte byteToAdd)
byteToAdd - is the byte which is added to this BufferedOutputSource instancepublic void reset()
public byte[] getBuffer()
buffer) of this BufferedOutputSource objectpublic int getBufferIndex()
bufferIndex)public int getIndex()
public String toString()
toString in class Objectpublic StringBuffer getStringBuffer()
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||