143144145146147148149150151152153
prot.writeString("key3"); prot.writeString("val3"); prot.writeMapEnd(); prot.writeFieldEnd(); prot.writeFieldBegin(new TField()); prot.writeListBegin(new TList()); prot.writeString("elem1"); prot.writeString("elem2"); prot.writeListEnd(); prot.writeFieldEnd();
150151152153154155156157158159160
prot.writeString("elem1"); prot.writeString("elem2"); prot.writeListEnd(); prot.writeFieldEnd(); prot.writeFieldBegin(new TField()); prot.writeString("bye!"); prot.writeFieldEnd(); prot.writeStructEnd(); trans.flush();
246247248249250251252253254255256
String testStr = "\"hello, world!\""; prot.writeStructBegin(new TStruct()); prot.writeFieldBegin(new TField()); prot.writeString(testStr); prot.writeFieldEnd(); prot.writeFieldBegin(new TField()); prot.writeListBegin(new TList());
250251252253254255256257258259260
prot.writeFieldBegin(new TField()); prot.writeString(testStr); prot.writeFieldEnd(); prot.writeFieldBegin(new TField()); prot.writeListBegin(new TList()); prot.writeString("elem1"); prot.writeString("elem2"); prot.writeListEnd(); prot.writeFieldEnd();
387388389390391392393394395396397
TCTLSeparatedProtocol prot = new TCTLSeparatedProtocol(trans, 10); prot.initialize(new Configuration(), new Properties()); prot.writeStructBegin(new TStruct()); prot.writeFieldBegin(new TField()); prot.writeString(null); prot.writeFieldEnd(); prot.writeFieldBegin(new TField()); prot.writeString(null);
391392393394395396397398399400401
prot.writeFieldBegin(new TField()); prot.writeString(null); prot.writeFieldEnd(); prot.writeFieldBegin(new TField()); prot.writeString(null); prot.writeFieldEnd(); prot.writeFieldBegin(new TField()); prot.writeI32(100);
395396397398399400401402403404405
prot.writeFieldBegin(new TField()); prot.writeString(null); prot.writeFieldEnd(); prot.writeFieldBegin(new TField()); prot.writeI32(100); prot.writeFieldEnd(); prot.writeFieldBegin(new TField()); prot.writeString(null);
399400401402403404405406407408409
prot.writeFieldBegin(new TField()); prot.writeI32(100); prot.writeFieldEnd(); prot.writeFieldBegin(new TField()); prot.writeString(null); prot.writeFieldEnd(); prot.writeFieldBegin(new TField()); prot.writeMapBegin(new TMap());
403404405406407408409410411412413
prot.writeFieldBegin(new TField()); prot.writeString(null); prot.writeFieldEnd(); prot.writeFieldBegin(new TField()); prot.writeMapBegin(new TMap()); prot.writeString(null); prot.writeString(null); prot.writeString("key2"); prot.writeString(null);
244245246247248249250251252253254