Java ByteBuffer Write writeDouble(double v, ByteBuffer buffer)

Here you can find the source of writeDouble(double v, ByteBuffer buffer)

Description

write Double

License

Open Source License

Declaration

public static void writeDouble(double v, ByteBuffer buffer) throws IOException 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;

public class Main {
    public static void writeDouble(double v, ByteBuffer buffer) throws IOException {
        writeLong(Double.doubleToRawLongBits(v), buffer);
    }/*from ww w  .j  ava2 s.  c  o  m*/

    public static void writeLong(long v, ByteBuffer buffer) throws IOException {
        buffer.order(ByteOrder.LITTLE_ENDIAN);
        buffer.putLong(v);
        buffer.order(ByteOrder.BIG_ENDIAN);
    }
}

Related

  1. writeCDouble(ByteBuffer buffer, double value)
  2. writeCharacterString(ByteBuffer buf, byte[] bytes)
  3. writeCInt(ByteBuffer buffer, int anInt)
  4. writeColorTable(ByteBuffer out, int numColors)
  5. writeDouble(ByteBuffer buffer, double d)
  6. writeEmpty(final ByteBuffer buffer, final int type)
  7. writeFakeImageData(ByteBuffer out, int lzwMinCodeSize)
  8. writeFFloat(ByteBuffer buffer, float value)
  9. writeFile(ByteBuffer data, File destination)