byte[] buf = new byte[1024];
try {
ZipOutputStream out = new ZipOutputStream(new FileOutputStream(_path));
Playlist playlist;
InputStream in;
String name;
Iterator<String> iter = _playlists.iterator();
while (iter.hasNext()) {
if (monitor.isCanceled()) {
out.close();
return;
}
playlist = Controller.getInstance().getPlaylistController().getPlaylistByName(iter.next());
monitor.subTask(Messages.getString("PlaylistExporter.ExportPlaylist") + " " + playlist.getName()); //$NON-NLS-1$ //$NON-NLS-2$
if (playlist != null) {
if (_format == PlaylistFormat.XSPF) {
name = playlist.getName() + SystemUtils.playlistXSPFExtension;
in = playlist.getPlaylistStreamAsXSPF();
} else {
name = playlist.getName() + SystemUtils.playlistM3UExtension;
in = playlist.getPlaylistStreamAsM3U();
}
// Add ZIP entry to output stream.
out.putNextEntry(new ZipEntry(name));