Java ByteBuffer Get getTriByte(ByteBuffer buf)

Here you can find the source of getTriByte(ByteBuffer buf)

Description

Reads a 'tri-byte' from the specified buffer.

License

Open Source License

Parameter

Parameter Description
buf The buffer.

Return

The value.

Declaration

public static int getTriByte(ByteBuffer buf) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.nio.ByteBuffer;

public class Main {
    /**//from  w ww .j  av  a 2 s  .  c o m
     * Reads a 'tri-byte' from the specified buffer.
     * @param buf The buffer.
     * @return The value.
     */
    public static int getTriByte(ByteBuffer buf) {
        return ((buf.get() & 0xFF) << 16) | ((buf.get() & 0xFF) << 8) | (buf.get() & 0xFF);
    }
}

Related

  1. getSmartOld(ByteBuffer in)
  2. getSurrogateKey(byte[] data, ByteBuffer buffer)
  3. getTableUuid(ByteBuffer rowKey)
  4. getTempByteBuffer()
  5. getTerminatedArray(ByteBuffer buf)
  6. getTruncatedInt(ByteBuffer bytes, int numBytes)
  7. getTsStartSyncByte(ByteBuffer packet, boolean synced)
  8. getTsSyncByte(ByteBuffer packet)
  9. getUByte(ByteBuffer b)