19 namespace Deveel.Data.Client {
28 : base(initial_database) {
40 private bool closed =
false;
47 internal void Setup(Stream rawin, Stream rawout) {
48 if (rawin == null || rawout == null) {
49 throw new IOException(
"rawin or rawin is null");
52 input =
new BinaryReader(
new BufferedStream(rawin, 32768));
53 output =
new BinaryWriter(
new BufferedStream(rawout, 32768));
57 protected override void SendCommand(byte[] command,
int offset,
int size) {
59 output.Write(command, 0, size);
66 throw new IOException(
"IDatabaseInterface is closed!");
69 int commandLength = input.ReadInt32();
70 byte[] buf =
new byte[commandLength];
71 input.Read(buf, 0, commandLength);
73 }
catch (NullReferenceException) {
74 Console.Out.WriteLine(
"Throwable generated at: " +
this);
BinaryReader input
The data input stream for the db protocol.
override void CloseConnection()
StreamDatabaseInterface(string initial_database)
override byte[] ReceiveCommand(int timeout)
BinaryWriter output
The data output stream for the db protocol.
void Setup(Stream rawin, Stream rawout)
Sets up the stream connection with the given input/output stream.
override void SendCommand(byte[] command, int offset, int size)
An stream implementation of an interface to a database.