/* Change playlist. The response comes as plain XML. */
public void sendChangePlaylist(ChannelListener listener, Playlist playlist, String xml, String packetDescription) throws DespotifyException {
/* Create channel and buffer. */
Channel channel = new Channel("Change-Playlist-Channel", Channel.Type.TYPE_PLAYLIST, listener);
byte[] xmlBytes = xml.getBytes();
ByteBuffer buffer = ByteBuffer.allocate(2 + 17 + 4 + 4 + 4 + 1 + 1 + xmlBytes.length);
/* Append channel id, playlist id and some bytes... */
buffer.putShort((short)channel.getId());
buffer.put(playlist.getByteUUID()); /* 16 bytes */
buffer.put((byte)0x00); // 0x00 for adding tracks, 0x02 for the rest?
buffer.putInt(playlist.getRevision().intValue());
buffer.putInt(playlist.getTracks().size());
buffer.putInt(playlist.getChecksum().intValue()); /* -1: Create playlist. */