Java ByteBuffer to Long Array getLongWithChecksum(ByteBuffer buffer, Adler32 checksum)

Here you can find the source of getLongWithChecksum(ByteBuffer buffer, Adler32 checksum)

Description

get Long With Checksum

License

Apache License

Declaration

static long getLongWithChecksum(ByteBuffer buffer, Adler32 checksum) 

Method Source Code

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

import java.nio.ByteBuffer;

import java.util.zip.Adler32;

public class Main {
    static long getLongWithChecksum(ByteBuffer buffer, Adler32 checksum) {
        final long value = buffer.getLong();
        checksum.update((int) (value & 0xFFFFL));
        checksum.update((int) (value >> 32));
        return value;
    }/*  w  w  w.  j  ava 2  s .  c  om*/
}

Related

  1. getLongBE(ByteBuffer b, int start, int end)
  2. getLongByteBuffer(long id)
  3. getLongFromBuffer(ByteBuffer buffer, int offset, int size)
  4. getLongFromByteBuffer(ByteBuffer data)
  5. getLongLE(final ByteBuffer b, final int start, final int end)