Java ByteBuffer to Long Array getLong(ByteBuffer longCalculator, byte[] bytes)

Here you can find the source of getLong(ByteBuffer longCalculator, byte[] bytes)

Description

Calculates the corresponding long given 8 sequential bytes.

License

LGPL

Parameter

Parameter Description
longCalculator Buffer to do the conversion
bytes The bytes

Return

Long value of the bytes

Declaration

public static float getLong(ByteBuffer longCalculator, byte[] bytes) 

Method Source Code


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

import java.nio.ByteBuffer;

public class Main {
    /**/*  w  ww.ja  v a 2  s. c o  m*/
     * Calculates the corresponding long given 8 sequential bytes.
     * @param longCalculator Buffer to do the conversion
     * @param bytes The bytes
     * @return Long value of the bytes
     */
    public static float getLong(ByteBuffer longCalculator, byte[] bytes) {
        longCalculator.clear();
        longCalculator.put(bytes);
        longCalculator.position(0);
        return longCalculator.getLong();
    }
}

Related

  1. deserializeLongArray(ByteBuffer buffer)
  2. getLong(ByteBuffer buffer)
  3. getLong(ByteBuffer byteBuffer, int longIndex)
  4. getLong(ByteBuffer in)
  5. getLongB(ByteBuffer bb, int index)
  6. getLongBE(ByteBuffer b, int start, int end)
  7. getLongByteBuffer(long id)
  8. getLongFromBuffer(ByteBuffer buffer, int offset, int size)