Add explicit cast to ByteBuffer for Java 8 compatibility

PiperOrigin-RevId: 451994696
(cherry picked from commit 1c5032e1a9091e0e53fc881581aaba8d7dfb2dd9)
This commit is contained in:
bachinger 2022-05-31 09:19:29 +00:00 committed by Marc Baechinger
parent 10a7e755aa
commit 401c220c32

View File

@ -200,8 +200,12 @@ public final class OpusDecoderTest {
return ImmutableList.of(HEADER, preSkip, CUSTOM_SEEK_PRE_ROLL_BYTES);
}
// The cast to ByteBuffer is required for Java 8 compatibility. See
// https://issues.apache.org/jira/browse/MRESOLVER-85
@SuppressWarnings("UnnecessaryCast")
private static ByteBuffer createSupplementalData(long value) {
return ByteBuffer.allocate(8).order(ByteOrder.LITTLE_ENDIAN).putLong(value).rewind();
return (ByteBuffer)
ByteBuffer.allocate(8).order(ByteOrder.LITTLE_ENDIAN).putLong(value).rewind();
}
private static DecoderInputBuffer createInputBuffer(