Java ByteBuffer Write writeDouble(ByteBuffer buffer, double d)

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

Description

write Double

License

Open Source License

Declaration

public static final void writeDouble(ByteBuffer buffer, double d) 

Method Source Code


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

public class Main {
    public static final void writeDouble(ByteBuffer buffer, double d) {
        writeLong(buffer, Double.doubleToLongBits(d));
    }//from   w  ww  . j  av a2  s .  c  om

    public static final void writeLong(ByteBuffer buffer, long l) {
        buffer.put((byte) (l & 0xff));
        buffer.put((byte) (l >>> 8));
        buffer.put((byte) (l >>> 16));
        buffer.put((byte) (l >>> 24));
        buffer.put((byte) (l >>> 32));
        buffer.put((byte) (l >>> 40));
        buffer.put((byte) (l >>> 48));
        buffer.put((byte) (l >>> 56));
    }
}

Related

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