/**
* Example.
*/
public static void main(String args[]) {
Element mockSource = new MockSource("source") {
{
bufs = new ByteBuffer[] {new ByteBuffer(new byte[] {1, 1, 2, 3, 4, 5}), new ByteBuffer(new byte[] {2, 1, 2, 3, 4}),
new ByteBuffer(new byte[] {3, 1, 2, 3}), new ByteBuffer(new byte[] {4, 1, 2}), new ByteBuffer(new byte[] {5, 1})};
verbose = true;
delay = 100;
numBuffers = bufs.length;
}
};
Element mockSink = new MockSink("sink") {
{
bufs = new ByteBuffer[] {new ByteBuffer(new byte[] {1, 1, 2, 3, 4, 5}), new ByteBuffer(new byte[] {2, 1, 2, 3, 4}),
new ByteBuffer(new byte[] {3, 1, 2, 3}), new ByteBuffer(new byte[] {4, 1, 2}), new ByteBuffer(new byte[] {5, 1})};
verbose = true;
}
};
Link link = new SyncLink() {
{
verbose = true;
}
};
mockSource.setLink(STDOUT, link, Direction.OUT);
mockSink.setLink(STDIN, link, Direction.IN);
link.run();
}