|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectOutputStream
LimitedOutputStream
class LimitedOutputStream
This class is useful only for testing the transmission speed of data by limiting the size of the output stream. Not to be used in production.
Field Summary | |
---|---|
private int |
limit
The limit on the number of bytes |
private OutputStream |
realOut
The output stream to receive the limited output |
private int |
total
How many bytes have been output so far |
Constructor Summary | |
---|---|
LimitedOutputStream(OutputStream realOut,
int limit)
Constructor. |
Method Summary | |
---|---|
void |
close()
Close the output stream |
void |
flush()
Flush any pending data to the output stream |
void |
write(byte[] b)
Write an array of bytes to the output stream |
void |
write(byte[] b,
int off,
int len)
Write a subset of bytes to the stream |
void |
write(int b)
Write a single byte to the stream |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private OutputStream realOut
private int total
private int limit
Constructor Detail |
---|
public LimitedOutputStream(OutputStream realOut, int limit)
realOut
- The output stream to receive the limited outputlimit
- How many characters to limit it to.Method Detail |
---|
public void close() throws IOException
close
in interface Closeable
close
in class OutputStream
IOException
public void flush() throws IOException
flush
in interface Flushable
flush
in class OutputStream
IOException
public void write(byte[] b) throws IOException
write
in class OutputStream
IOException
public void write(byte[] b, int off, int len) throws IOException
write
in class OutputStream
IOException
public void write(int b) throws IOException
write
in class OutputStream
IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |