code: public void write(DataOutputStream stream, byte sequenceId) throws IOException {
          this.sequenceId = sequenceId;
          stream.write(PREAMBLE);
          stream.write(sequenceId);
          stream.write(action.getCode());
          stream.write(buffer.toArray());
          stream.write(Constants.EOD);
      }
docs: Write request components to output stream.
  
  @param stream Output stream.
  @param sequenceId Sequence identifier for packet.
  @throws IOException An IO exception.