-import static com.google.common.base.Preconditions.*;
-import static net.pterodactylus.sonitus.data.Format.UNKNOWN_CHANNELS;
-import static net.pterodactylus.sonitus.data.Format.UNKNOWN_ENCODING;
-import static net.pterodactylus.sonitus.data.Format.UNKNOWN_FREQUENCY;
+import static com.google.common.base.Preconditions.checkNotNull;
import java.io.EOFException;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Arrays;
import java.io.EOFException;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Arrays;
-import net.pterodactylus.sonitus.data.Format;
-import net.pterodactylus.sonitus.data.Source;
+import net.pterodactylus.sonitus.data.AbstractFilter;
+import net.pterodactylus.sonitus.data.Controller;
+import net.pterodactylus.sonitus.data.Filter;
+import net.pterodactylus.sonitus.data.Metadata;
* if the file can not be found, or an I/O error occurs
*/
public FileSource(String path) throws IOException {
* if the file can not be found, or an I/O error occurs
*/
public FileSource(String path) throws IOException {
this.path = checkNotNull(path, "path must not be null");
fileInputStream = new FileInputStream(path);
/* identify file type. */
Optional<IdentifyingInputStream> identifyingInputStream = IdentifyingInputStream.create(new FileInputStream(path));
if (identifyingInputStream.isPresent()) {
this.path = checkNotNull(path, "path must not be null");
fileInputStream = new FileInputStream(path);
/* identify file type. */
Optional<IdentifyingInputStream> identifyingInputStream = IdentifyingInputStream.create(new FileInputStream(path));
if (identifyingInputStream.isPresent()) {
throw new EOFException();
}
return Arrays.copyOf(buffer, read);
throw new EOFException();
}
return Arrays.copyOf(buffer, read);