1 /// Licensed to the Apache Software Foundation (ASF) under one
2 /// or more contributor license agreements. See the NOTICE file
3 /// distributed with this work for additional information
4 /// regarding copyright ownership. The ASF licenses this file
5 /// to you under the Apache License, Version 2.0 (the
6 /// "License"); you may not use this file except in compliance
7 /// with the License. You may obtain a copy of the License at
9 /// http://www.apache.org/licenses/LICENSE-2.0
11 /// Unless required by applicable law or agreed to in writing,
12 /// software distributed under the License is distributed on an
13 /// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 /// KIND, either express or implied. See the License for the
15 /// specific language governing permissions and limitations
16 /// under the License.
20 abstract class TProtocol {
21 final TTransport transport;
23 TProtocol(this.transport);
26 void writeMessageBegin(TMessage message);
27 void writeMessageEnd();
29 void writeStructBegin(TStruct struct);
30 void writeStructEnd();
32 void writeFieldBegin(TField field);
34 void writeFieldStop();
36 void writeMapBegin(TMap map);
39 void writeListBegin(TList list);
42 void writeSetBegin(TSet set);
45 void writeBool(bool b);
47 void writeByte(int b);
49 void writeI16(int i16);
51 void writeI32(int i32);
53 void writeI64(int i64);
55 void writeDouble(double d);
57 void writeString(String str);
59 void writeBinary(Uint8List bytes);
62 TMessage readMessageBegin();
63 void readMessageEnd();
65 TStruct readStructBegin();
68 TField readFieldBegin();
74 TList readListBegin();
94 Uint8List readBinary();