Java ByteBuffer Write writeFloat(ByteBuffer buffer, float f)

Here you can find the source of writeFloat(ByteBuffer buffer, float f)

Description

write Float

License

Open Source License

Declaration

public static final void writeFloat(ByteBuffer buffer, float f) 

Method Source Code


//package com.java2s;
import java.nio.ByteBuffer;

public class Main {
    public static final void writeFloat(ByteBuffer buffer, float f) {
        writeInt(buffer, Float.floatToIntBits(f));
    }//from w ww.ja v a 2 s .co m

    public static final void writeInt(ByteBuffer buffer, int i) {
        buffer.put((byte) (i & 0xff));
        buffer.put((byte) (i >>> 8));
        buffer.put((byte) (i >>> 16));
        buffer.put((byte) (i >>> 24));
    }
}

Related

  1. writeFFloat(ByteBuffer buffer, float value)
  2. writeFile(ByteBuffer data, File destination)
  3. writeFile(File file, ByteBuffer bb)
  4. writeFile(File file, ByteBuffer buffer)
  5. writeFileFragment(FileChannel fc, long pos, ByteBuffer fragment)
  6. writeFromBuffer(SocketChannel channel, ByteBuffer buf, int sleepMsecs)
  7. writeFully(@Nonnull final FileChannel dst, @Nonnull final ByteBuffer src, @Nonnegative final long position)
  8. writeFully(ByteBuffer buf, WritableByteChannel out)
  9. writeFully(ByteBuffer buffer, WritableByteChannel channel)