* updated output stream test to match new API

* new paired stream server and client helpers
This commit is contained in:
jrandom
2004-10-28 02:05:51 +00:00
committed by zzz
parent 48cdf17a4f
commit d5607ca195
3 changed files with 66 additions and 1 deletions

View File

@@ -53,11 +53,20 @@ public class MessageOutputStreamTest {
public Receiver() {
_data = new ByteArrayOutputStream();
}
public void writeData(byte[] buf, int off, int size) throws IOException {
public MessageOutputStream.WriteStatus writeData(byte[] buf, int off, int size) {
_data.write(buf, off, size);
return new DummyWriteStatus();
}
public byte[] getData() { return _data.toByteArray(); }
}
private static class DummyWriteStatus implements MessageOutputStream.WriteStatus {
public void waitForAccept(int maxWaitMs) { return; }
public void waitForCompletion(int maxWaitMs) { return; }
public boolean writeAccepted() { return true; }
public boolean writeFailed() { return false; }
public boolean writeSuccessful() { return true; }
}
public static void main(String args[]) {
MessageOutputStreamTest t = new MessageOutputStreamTest();