Java ByteBuffer Set setUniqueness(ByteBuffer bb, long uniqueness)

Here you can find the source of setUniqueness(ByteBuffer bb, long uniqueness)

Description

set Uniqueness

License

Apache License

Declaration

private static void setUniqueness(ByteBuffer bb, long uniqueness) 

Method Source Code

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

import java.nio.ByteBuffer;

public class Main {
    private static final int uniquenessPos = Long.SIZE / Byte.SIZE;

    private static void setUniqueness(ByteBuffer bb, long uniqueness) {
        bb.putLong(uniquenessPos, uniqueness);
    }/*from   ww  w .  j  a  va 2 s.  co m*/

    private static void setUniqueness(ByteBuffer bb, byte[] uniqueness) {
        for (int i = 0; i < Long.SIZE / Byte.SIZE; ++i) {
            bb.put(uniquenessPos + i, uniqueness[i]);
        }
    }
}

Related

  1. setLong(ByteBuffer buffer, long data)
  2. setSByte(ByteBuffer buffer, byte data)
  3. setSInt(ByteBuffer buffer, int data)
  4. setString(ByteBuffer buffer, int index)
  5. setString(ByteBuffer buffer, String data)
  6. setUnsignedInt32(ByteBuffer buffer, int offset, long value)
  7. setZipEocdCentralDirectoryOffset(ByteBuffer zipEndOfCentralDirectory, long offset)
  8. subsequence(ByteBuffer[] bs, int offset, int length)
  9. substringBetweenLast(final byte[] text, final int offset, final int limit, final byte[] start, final byte[] end, final boolean trim, ByteBuffer bb)