- rememberingInputStream = new RememberingInputStream(rememberingInputStream.remembered());
- InputStream limitedInputStream = ByteStreams.limit(rememberingInputStream, 1048576);
- format = Mp3Identifier.identify(limitedInputStream);
- if (format.isPresent()) {
- return Optional.of(new IdentifyingInputStream(rememberingInputStream.remembered(), format.get()));
+ try {
+ rememberingInputStream = new RememberingInputStream(rememberingInputStream.remembered());
+ InputStream limitedInputStream = ByteStreams.limit(rememberingInputStream, 1048576);
+ Optional<Metadata> metadata = Mp3Identifier.identify(limitedInputStream);
+ if (metadata.isPresent()) {
+ return Optional.of(new IdentifyingInputStream(rememberingInputStream.remembered(), metadata.get()));
+ }
+ } catch (EOFException eofe1) {
+ /* ignore. */