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);