ByteUtils: fix redundant type casts

This commit is contained in:
Andreas Schildbach 2022-06-23 17:02:10 +02:00
parent 91f22138e8
commit 8ab62e7149

View file

@ -114,14 +114,14 @@ public class ByteUtils {
/** Write 2 bytes to the output stream as unsigned 16-bit integer in little endian format. */
public static void uint16ToByteStreamLE(int val, OutputStream stream) throws IOException {
stream.write((int) (0xFF & val));
stream.write((int) (0xFF & (val >> 8)));
stream.write(0xFF & val);
stream.write(0xFF & (val >> 8));
}
/** Write 2 bytes to the output stream as unsigned 16-bit integer in big endian format. */
public static void uint16ToByteStreamBE(int val, OutputStream stream) throws IOException {
stream.write((int) (0xFF & (val >> 8)));
stream.write((int) (0xFF & val));
stream.write(0xFF & (val >> 8));
stream.write(0xFF & val);
}
/** Write 4 bytes to the output stream as unsigned 32-bit integer in little endian format. */