Java ByteBuffer Read readReal(ByteBuffer bb)

Here you can find the source of readReal(ByteBuffer bb)

Description

read Real

License

LGPL

Declaration

public static double readReal(ByteBuffer bb) throws IOException 

Method Source Code

//package com.java2s;
//License from project: LGPL 

import java.io.IOException;

import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.channels.FileChannel;

public class Main {
    public static double readReal(FileChannel channel) throws IOException {
        ByteBuffer bb = ByteBuffer.allocate(8);
        bb.order(ByteOrder.LITTLE_ENDIAN);
        channel.read(bb);//from ww  w.  ja  v  a  2  s  . co m
        bb.rewind();
        return bb.getDouble();
    }

    public static double readReal(ByteBuffer bb) throws IOException {
        return bb.getDouble();
    }
}

Related

  1. readLink(ByteBuffer bb)
  2. readLink(ByteBuffer bb)
  3. readNewLine(ByteBuffer buf)
  4. readNullTerminatedString(ByteBuffer buf)
  5. readObject(ByteBuffer byteBuffer)
  6. readResBit15(ByteBuffer fromBuffer)
  7. readShortLE(ByteBuffer buf, int i)
  8. readShortLength(ByteBuffer bb)
  9. readShorts(final ByteBuffer bb, final int length)