-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;
* 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()) {
- public Format format() {
- return format;
- }
-
- @Override
- public Metadata metadata() {
- return new Metadata().name(path);
+ public List<Controller<?>> controllers() {
+ return Collections.emptyList();
throw new EOFException();
}
return Arrays.copyOf(buffer, read);
throw new EOFException();
}
return Arrays.copyOf(buffer, read);