2
* Created on 19-dic-2005
4
* TODO To change the template for this generated file go to
5
* Window - Preferences - Java - Code Style - Code Templates
7
package org.herac.tuxguitar.io.base;
9
import java.io.BufferedInputStream;
10
import java.io.InputStream;
11
import java.util.Iterator;
13
import org.herac.tuxguitar.song.factory.TGFactory;
14
import org.herac.tuxguitar.song.models.TGSong;
19
* TODO To change the template for this generated type comment go to
20
* Window - Preferences - Java - Code Style - Code Templates
22
public class TGSongLoader {
24
public TGSongLoader(){
30
* @throws TGFileFormatException
32
public TGSong load(TGFactory factory,InputStream is) throws TGFileFormatException{
34
BufferedInputStream stream = new BufferedInputStream(is);
36
Iterator it = TGFileFormatManager.instance().getInputStreams();
38
TGInputStreamBase reader = (TGInputStreamBase)it.next();
39
reader.init(factory,stream);
40
if(reader.isSupportedVersion()){
41
return reader.readSong();
47
throw new TGFileFormatException(t);
49
throw new TGFileFormatException("Unsupported file format");
b'\\ No newline at end of file'