code: public void serialize(final DataOutput output) throws TTIOException {
          try {
              output.writeLong(dataKey);
              output.writeBoolean(eof);
              output.writeInt(val.length);
              output.write(val);
          } catch (final IOException exc) {
              throw new TTIOException(exc);
          }
      }
docs: Serializing to given dataput
  
  @throws TTIOException