I really can't believe I'm asking this but everything I read is either converting from int to byte to string to byte or something. I am literally trying to insert a byte into a byte array. Or for that matter, initialize a byte array with bytes, not ints.
byte[] header = {0x8b, 0x1f, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03};
The compiler complains that they are ints. I'm trying to insert bytes.
byte
is a signed integer in the range [-128,127]
. 0x8b
is 139d
, so you'll need to cast it to a byte (byte)0x8b
or use a value in the proper range such as -0x75
(the equivalent of casting 0x8b
to byte
).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With