// Read and write encodable protected static void writeEncodable(ByteStream source, Encodable type, int contextId) { if (type.GetType().IsSubclassOf(typeof(Primitive.Primitive))) { ((Primitive.Primitive)type).WriteEncodable(source, contextId); } else { type.write(source, contextId); } }
protected static void write(ByteStream source, Encodable type, int contextId) { type.write(source, contextId); }
// // Basic read and write. Pretty trivial. protected static void write(ByteStream source, Encodable type) { type.write(source); }