Java ByteBuffer to Long readUB4(ByteBuffer buffer)

Here you can find the source of readUB4(ByteBuffer buffer)

Description

read UB

License

LGPL

Declaration

public static long readUB4(ByteBuffer buffer) 

Method Source Code

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

import java.nio.ByteBuffer;

public class Main {
    public static long readUB4(ByteBuffer buffer) {
        long ret = (long) (buffer.get() & 0xff);
        ret |= (long) (buffer.get() & 0xff) << 8;
        ret |= (long) (buffer.get() & 0xff) << 16;
        ret |= (long) (buffer.get() & 0xff) << 24;
        return ret;
    }/* w  w  w.  j ava 2s  .com*/
}

Related

  1. readLong(ByteBuffer logBuf)
  2. readLong64ls(int size, ByteBuffer byteBuf)
  3. readLongArray(ByteBuffer bb)
  4. readLongLE(ByteBuffer buf, int i)
  5. readUB1(ByteBuffer buffer)
  6. readUBEInt16(ByteBuffer b)
  7. readUInt16(ByteBuffer bb)
  8. readUInt16BE(ByteBuffer bb)
  9. readUInt32(ByteBuffer buf, int length)