code: protected synchronized void do_send(final OtpOutputStream header,
              final OtpOutputStream payload) throws IOException {
          try {
              if (traceLevel >= sendThreshold) {
                  // Need to decode header and output buffer to show trace
                  // message!
                  // First make OtpInputStream, then decode.
                  try {
                      final OtpErlangObject h = header.getOtpInputStream(5)
                              .read_any();
                      System.out.println("-> " + headerType(h) + " " + h);
  
                      OtpErlangObject o = payload.getOtpInputStream(0).read_any();
                      System.out.println("   " + o);
                      o = null;
                  } catch (final OtpErlangDecodeException e) {
                      System.out.println("   " + "can't decode output buffer:"
                              + e);
                  }
              }
  
              // group flush op in favour of possible ssh-tunneled stream
              OutputStream out = socket.getOutputStream();
              header.writeTo(out);
              payload.writeTo(out);
              out.flush();
          } catch (final IOException e) {
              close();
              throw e;
          }
      }
docs: used by send and send_reg (message types with payload)