ByteBuffer buf = new ByteBuffer(length, true);
// Type (high nibble) = 0xe = CR TPDU; credit (low nibble) = 0
buf.writeByte(X224_TPDU_CONNECTION_REQUEST);
buf.writeShort(0); // Destination reference = 0
buf.writeShort(0); // Source reference = 0
buf.writeByte(0); // Class and options = 0
buf.writeString("Cookie: mstshash=" + userName + "\r\n", RdpConstants.CHARSET_8); // Cookie
// RDP_NEG_REQ::type