moved some files and fixed javadoc

This commit is contained in:
Ziver Koc 2010-08-13 22:27:55 +00:00
parent 7176c87c08
commit 58a3113819
5 changed files with 147 additions and 20 deletions

View file

@ -0,0 +1,48 @@
package zutil.io;
import java.io.OutputStream;
/**
* This class saves all the input data in to an StringBuffer
*
* @author Ziver
*
*/
public class StringOutputStream extends OutputStream{
// The buffer
protected StringBuilder buffer;
/**
* Creates an new instance of this class
*/
public StringOutputStream(){
clear();
}
@Override
public void write(int b) {
buffer.append( b );
}
@Override
public void write(byte[] b) {
buffer.append( new String(b) );
}
@Override
public void write(byte[] b, int off, int len) {
buffer.append( new String(b, off, len) );
}
public void clear(){
buffer = new StringBuilder();
}
/**
* @return the String with the data
*/
@Override
public String toString() {
return buffer.toString();
}
}