Java ByteBuffer to Int Array getInt(ByteBuffer bb, int bi)

Here you can find the source of getInt(ByteBuffer bb, int bi)

Description

get Int

License

Apache License

Declaration

public static int getInt(ByteBuffer bb, int bi) 

Method Source Code

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

import java.nio.ByteBuffer;

public class Main {
    public static int getInt(ByteBuffer bb, int bi) {
        return makeInt(bb.get(bi + 3), bb.get(bi + 2), bb.get(bi + 1), bb.get(bi));
    }/*w  w  w  .j  ava  2  s.c  o m*/

    static private int makeInt(byte b3, byte b2, byte b1, byte b0) {
        return (((b3) << 24) | ((b2 & 0xff) << 16) | ((b1 & 0xff) << 8) | ((b0 & 0xff)));
    }
}

Related

  1. deserializeIntArray(ByteBuffer buffer)
  2. deserializeIntArray(ByteBuffer buffer)
  3. getInt(ByteBuffer b, int n)
  4. getInt(ByteBuffer bb)
  5. getInt(ByteBuffer buffer, ByteOrder order)
  6. getInt(ByteBuffer byteBuffer)
  7. getInt(ByteBuffer intCalculator, byte[] bytes)
  8. getInt8(ByteBuffer input)