float to byte java code example
Example: Float to bytes java
int intBits = Float.floatToIntBits(value);
byte[] bs = new byte[] {
(byte) (intBits >> 24),
(byte) (intBits >> 16),
(byte) (intBits >> 8),
(byte) (intBits)
};
int intBits = Float.floatToIntBits(value);
byte[] bs = new byte[] {
(byte) (intBits >> 24),
(byte) (intBits >> 16),
(byte) (intBits >> 8),
(byte) (intBits)
};