Java Convert via ByteBuffer longToByteArray(long[] array)

Here you can find the source of longToByteArray(long[] array)

Description

long To Byte Array

License

Open Source License

Declaration

public static byte[] longToByteArray(long[] array) 

Method Source Code

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

public class Main {
    public static byte[] longToByteArray(long[] array) {
        byte[] result = new byte[array.length * 8];
        ByteBuffer buffer = ByteBuffer.wrap(result);
        for (int i = 0; i < array.length; i++) {
            buffer.putLong(array[i]);//  www.  j av a 2  s  .  c  om
        }
        return result;
    }
}

Related

  1. longFromBytes(byte[] value)
  2. longTo4ByteArray(long n)
  3. longToByteArray(long l)
  4. longToByteArray(long value)
  5. longToByteArray(long value)
  6. longToBytes(final long value)
  7. longToBytes(long aLong)
  8. longToBytes(long l)
  9. longToBytes(long l, int size)