handshake.writeShort(port); // port
handshake.writeByte(0x00); // fake ip
handshake.writeByte(0x00); // fake ip
handshake.writeByte(0x00); // fake ip
handshake.writeByte(0x01); // fake ip
handshake.writeBytes(userBytes); // user name
handshake.writeByte(0x00); // null terminating the string
handshake.writeBytes(hostNameBytes); // remote host name to connect to
handshake.writeByte(0x00); // null terminating the string
return handshake;
}