Allow schema files that are missing checksums on the !!SCHEMAMATIC line.
[versaplex.git] / wvdotnet / wvloopback.cs
blob73e4ce089e7cca16c0914cf9d990a76cf75e447e
1 /*
2 * Versaplex:
3 * Copyright (C)2007-2008 Versabanq Innovations Inc. and contributors.
4 * See the included file named LICENSE for license information.
5 */
6 using System;
8 namespace Wv
10 public class WvLoopback : WvStream
12 WvBuf mybuf = new WvBuf();
14 public WvLoopback()
16 post_writable();
19 public override int read(WvBytes b)
21 int max = b.len < mybuf.used ? b.len : mybuf.used;
22 b.put(0, mybuf.get(max));
23 if (mybuf.used > 0)
24 post_readable();
25 return max;
28 public override int write(WvBytes b)
30 mybuf.put(b);
31 post_readable();
32 post_writable();
33 return b.len;