Android Byte Array to Long Convert getLongFromByteArray(final byte[] bytes)

Here you can find the source of getLongFromByteArray(final byte[] bytes)

Description

Converts a byte array to a long.

Parameter

Parameter Description
bytes the bytes

Return

the long from byte array

Declaration

public static long getLongFromByteArray(final byte[] bytes) 

Method Source Code

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

public class Main {
    /**/* w  w  w .  ja v  a  2  s.  c o  m*/
     * Converts a byte array to a long.
     *
     * @param bytes the bytes
     * @return the long from byte array
     */
    public static long getLongFromByteArray(final byte[] bytes) {
        return ByteBuffer.wrap(bytes).getLong();
    }
}

Related

  1. getLong(byte[] buf, boolean bigEndian)
  2. getLong(byte[] buf, int pos, boolean bigEndian)
  3. getLong(byte[] bytes)
  4. getLong4(byte[] b, int offset)
  5. getLong5(byte[] b, int offset)
  6. toLong(byte[] b, int pos)
  7. toLong(byte[] b, int pos, int width)
  8. toLong(byte[] src)
  9. toLong(byte[] src, int srcPos)