concept write in category apache thrift

appears as: The write, write, writes, write, writes
Programmer's Guide to Apache Thrift

This is an excerpt from Manning's book Programmer's Guide to Apache Thrift.

The trivial Date type 1 illustrated in pseudo code above has the exact fields described in the IDL and is organized into a class with the same name as the IDL struct. The Apache Thrift compiler creates read() 2 and write() 3 methods to automate the process of serializing the type through the Apache Thrift TProtocol interface. This makes transmitting a complex data structure as easy as calling read or write on the structure with the target Apache Thrift Protocol as a parameter.

This program is trivial by design and meant to illustrate the type serializing features of a more advanced Apache Thrift UDT with as little distraction as possible. The program serializes a RadioObservation to disk if the string “write” is supplied on the command line, and de-serializes a RadioObservation if the string “read” is supplied on the command line. The UDT is displayed to the console in both cases. Writes can optionally include a sky_bmp image if the write parameter is followed by the string “BMP”. The file “quasar.bmp” from figure 7.4 is always used as the image source and supplied with the sample code. See the following listing.