Created
November 25, 2017 08:02
-
-
Save valentyn-zaitsev/cdc899066eff9bd02f2563caed659dc2 to your computer and use it in GitHub Desktop.
Float to Byte array (java)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static byte[] FloatToByteArray(float value) { | |
byte[] bytes = new byte[4]; | |
ByteBuffer.wrap(bytes).putFloat(value); | |
return bytes; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment