Java ByteBuffer to Double toDouble(ByteBuffer value)

Here you can find the source of toDouble(ByteBuffer value)

Description

to Double

License

Open Source License

Declaration

public static double toDouble(ByteBuffer value) 

Method Source Code

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

import java.nio.ByteBuffer;

public class Main {
    public static double toDouble(ByteBuffer value) {
        double result = 0d;
        try {//from   w w  w .  ja  va 2 s  .c om
            if (value != null) {
                int originPos = value.position();
                result = value.getDouble();
                value.position(originPos);
            }
        } catch (Exception ex) {
            // ex.printStackTrace();
        }
        return result;

    }
}

Related

  1. readDouble(ByteBuffer buffer)
  2. readDouble(ByteBuffer buffer)
  3. toDouble(ByteBuffer buffer)
  4. toDouble(ByteBuffer bytes)