Some general-purpose lint cleanup

This commit is contained in:
TacoTheDank 2020-08-27 16:56:58 -04:00 committed by Stypox
parent 273c287fbf
commit f86b40302d
No known key found for this signature in database
GPG key ID: 4BDF1B40A49FDD23
17 changed files with 24 additions and 31 deletions

View file

@ -236,7 +236,7 @@ public class DataReader {
if (read != amount) {
throw new EOFException("Truncated stream, missing "
+ String.valueOf(amount - read) + " bytes");
+ (amount - read) + " bytes");
}
for (int i = 0; i < amount; i++) {

View file

@ -5,8 +5,8 @@ import org.schabi.newpipe.streams.io.SharpStream;
import java.io.EOFException;
import java.io.IOException;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.nio.ByteBuffer;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.NoSuchElementException;
@ -259,11 +259,7 @@ public class Mp4DashReader {
}
private String boxName(final int type) {
try {
return new String(ByteBuffer.allocate(4).putInt(type).array(), "UTF-8");
} catch (final UnsupportedEncodingException e) {
return "0x" + Integer.toHexString(type);
}
return new String(ByteBuffer.allocate(4).putInt(type).array(), StandardCharsets.UTF_8);
}
private Box readBox() throws IOException {

View file

@ -293,7 +293,7 @@ public class WebMReader {
if (metadataExpected && (obj.info == null || obj.tracks == null)) {
throw new RuntimeException(
"Cluster element found without Info and/or Tracks element at position "
+ String.valueOf(ref.offset));
+ ref.offset);
}
return obj;
@ -389,7 +389,7 @@ public class WebMReader {
final Element elem = untilElement(ref, ID_TIMECODE);
if (elem == null) {
throw new NoSuchElementException("Cluster at " + String.valueOf(ref.offset)
throw new NoSuchElementException("Cluster at " + ref.offset
+ " without Timecode element");
}
obj.timecode = readNumber(elem);
@ -520,7 +520,7 @@ public class WebMReader {
currentSimpleBlock = readSimpleBlock(elem);
if (currentSimpleBlock.trackNumber == tracks[selectedTrack].trackNumber) {
currentSimpleBlock.data = stream.getView((int) currentSimpleBlock.dataSize);
currentSimpleBlock.data = stream.getView(currentSimpleBlock.dataSize);
// calculate the timestamp in nanoseconds
currentSimpleBlock.absoluteTimeCodeNs = currentSimpleBlock.relativeTimeCode