code: private void writeVersionHeader(final Channel channel, final boolean fullVersionList) throws IOException {
          CancellableDataOutputStream dos = new CancellableDataOutputStream(channel.writeMessage());
          try {
              dos.writeBytes(JMX);
              byte[] versions = getSupportedVersions(fullVersionList);
              dos.writeInt(versions.length);
              dos.write(versions);
              if (Version.isSnapshot()) {
                  dos.write(SNAPSHOT);
              } else {
                  dos.write(STABLE);
              }
  
              if (fullVersionList) {
                  String remotingJMXVersion = Version.getVersionString();
                  byte[] versionBytes = remotingJMXVersion.getBytes("UTF-8");
                  dos.writeInt(versionBytes.length);
                  dos.write(versionBytes);
              }
          } catch (IOException e) {
              dos.cancel();
              throw e;
          } finally {
              dos.close();
          }
      }
docs: Write the header message to the client.
  <p/>
  The header message will contain the following items to allow the client to select a version: -
  <p/>
  - The bytes for the characters 'JMX' - not completely fail safe but will allow early detection the client is connected to
  the correct channel. - The number of versions supported by the server. (single byte) - The versions listed sequentially.
  - A single byte to identify if the server is a SNAPSHOT release 0x00 = Stable, 0x01 - Snapshot
  
  @param channel
  @throws IOException