home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 1997 October
/
Chip_1997-10_cd.bin
/
tema
/
sybase
/
powerj
/
samples.z
/
TextBoxOutputStream.java
< prev
next >
Wrap
Text File
|
1996-12-09
|
886b
|
36 lines
import java.io.OutputStream;
import powersoft.jcm.ui.TextBox;
public class TextBoxOutputStream extends OutputStream
{
public TextBoxOutputStream( TextBox box )
{
_box = box;
}
public void write( byte b[] )
{
StringBuffer buf = new StringBuffer(b.length);
for( int i = 0; i < b.length; i++ ) {
buf.append( (char)b[i] );
}
_box.setText( _box.getText() + buf.toString() );
}
public void write( byte b[], int off, int len )
{
StringBuffer buf = new StringBuffer(len);
for( int i = 0; i < len; i++ ) {
buf.append( (char) b[ off + i ] );
}
_box.setText( _box.getText() + buf.toString() );
}
public void write( int b )
{
_box.setText( _box.getText() + (char)b );
}
private TextBox _box;
}