Java ByteBuffer to Long toLong(ByteBuffer value)

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

Description

to Long

License

Open Source License

Declaration

public static long toLong(ByteBuffer value) 

Method Source Code

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

import java.nio.ByteBuffer;

public class Main {
    public static long toLong(ByteBuffer value) {
        long result = 0;
        try {/*  w w w  . j  av a 2 s . c  o  m*/
            if (value != null) {
                int originPos = value.position();
                result = value.getLong();
                value.position(originPos);
            }
        } catch (Exception ex) {
            // ex.printStackTrace();
        }
        return result;
    }
}

Related

  1. readVarLong(ByteBuffer buff)
  2. readVarlong(ByteBuffer buffer)
  3. toLong(ByteBuffer buffer)
  4. toLong(ByteBuffer buffer)
  5. toLong(ByteBuffer bytes)