code: public byte[] serialize() {
          byte[] value = serializeValue();
          ByteBuffer buffer = ByteBuffer.allocate(value.length + 4);
          buffer.putShort(tag);
          buffer.putShort((short)value.length);
          buffer.put(value);
          return buffer.array();
      }
docs: Convert the optional parameter into a byte serialized form conforming to the SMPP specification.
  
  @return A byte array according to the SMPP specification