public void send(T message) throws IOException {
    ByteArrayOutputStream buffer = new ByteArrayOutputStream();
    try (ObjectOutputStream oos = new ObjectOutputStream(buffer)) { oos.writeObject(message); }
    String data = Base64.getEncoder().encodeToString(buffer.toByteArray());

    myOut.newLine();
    myOut.write(MSG_BEGIN);
    myOut.newLine();
    myOut.write(data);
    myOut.newLine();
    myOut.write(MSG_END);
    myOut.newLine();
    myOut.flush();
  }
public void send(T message)