31 lines
1.0 KiB
C#
31 lines
1.0 KiB
C#
namespace bts {
|
|
using System.IO;
|
|
using BCG;
|
|
|
|
using System.IO;
|
|
using System.Threading.Tasks.Dataflow;
|
|
|
|
public class RemoteRequest {
|
|
public readonly string stream_expression;
|
|
public readonly string published_table_name;
|
|
public RemoteRequest(string stream_expression_, string published_table_name_) {
|
|
stream_expression = stream_expression_;
|
|
published_table_name = published_table_name_;
|
|
}
|
|
public byte[] serialize() {
|
|
var str = new MemoryStream();
|
|
var bw = new BinaryWriter(str);
|
|
bw.write_string_cpp(stream_expression);
|
|
bw.write_string_cpp(published_table_name);
|
|
return str.ToArray();
|
|
}
|
|
|
|
public static RemoteRequest construct_from_bytes(byte[] ser_bytes) {
|
|
BinaryReader br = new BinaryReader(new MemoryStream(ser_bytes));
|
|
string stream_expression_ = br.read_string_cpp();
|
|
string published_table_name_ = br.read_string_cpp();
|
|
return new RemoteRequest(stream_expression_, published_table_name_);
|
|
|
|
}
|
|
}
|
|
} |