mirror of
https://github.com/bitcoinj/bitcoinj.git
synced 2025-02-23 14:40:40 +01:00
ByteUtils: fix redundant type casts
This commit is contained in:
parent
91f22138e8
commit
8ab62e7149
1 changed files with 4 additions and 4 deletions
|
@ -114,14 +114,14 @@ public class ByteUtils {
|
||||||
|
|
||||||
/** Write 2 bytes to the output stream as unsigned 16-bit integer in little endian format. */
|
/** 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 {
|
public static void uint16ToByteStreamLE(int val, OutputStream stream) throws IOException {
|
||||||
stream.write((int) (0xFF & val));
|
stream.write(0xFF & val);
|
||||||
stream.write((int) (0xFF & (val >> 8)));
|
stream.write(0xFF & (val >> 8));
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Write 2 bytes to the output stream as unsigned 16-bit integer in big endian format. */
|
/** 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 {
|
public static void uint16ToByteStreamBE(int val, OutputStream stream) throws IOException {
|
||||||
stream.write((int) (0xFF & (val >> 8)));
|
stream.write(0xFF & (val >> 8));
|
||||||
stream.write((int) (0xFF & val));
|
stream.write(0xFF & val);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Write 4 bytes to the output stream as unsigned 32-bit integer in little endian format. */
|
/** Write 4 bytes to the output stream as unsigned 32-bit integer in little endian format. */
|
||||||
|
|
Loading…
Add table
Reference in a new issue