Skip to content

Commit

Permalink
Add explicit cast to ByteBuffer for Java 8 compatibility
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 451994696
  • Loading branch information
marcbaechinger committed May 31, 2022
1 parent 7fc9bb9 commit 1c5032e
Showing 1 changed file with 5 additions and 1 deletion.
Expand Up @@ -200,8 +200,12 @@ private static ImmutableList<byte[]> createInitializationData(long preSkipNanos)
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(
Expand Down

0 comments on commit 1c5032e

Please sign in to comment.