write OV Float to OutputStream - Java java.io

Java examples for java.io:OutputStream

Description

write OV Float to OutputStream

Demo Code


//package com.java2s;
import java.io.IOException;

import java.io.OutputStream;

public class Main {
    public static void writeOVFloat(OutputStream os, float value)
            throws IOException {
        int intToWrite = Float.floatToIntBits(value);
        os.write((int) (intToWrite & 0xff));
        os.write((int) ((intToWrite >> 8) & 0xff));
        os.write((int) ((intToWrite >> 16) & 0xff));
        os.write((int) ((intToWrite >> 24) & 0xff));
    }/*w ww .j a  v a 2  s  .c  o  m*/
}

Related Tutorials