Java ByteBuffer Decode decodeInt(ByteBuffer buffer, int start)

Here you can find the source of decodeInt(ByteBuffer buffer, int start)

Description

decode Int

License

Apache License

Declaration

public static int decodeInt(ByteBuffer buffer, int start) 

Method Source Code

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

import java.nio.ByteBuffer;

public class Main {
    public static int decodeInt(byte[] value, int start) {
        return ((value[start] & 0xFF) << 24) + ((value[start + 1] & 0xFF) << 16) + ((value[start + 2] & 0xFF) << 8)
                + (value[start + 3] & 0xFF);
    }// w  w  w .  j av a  2  s.  c o m

    public static int decodeInt(ByteBuffer buffer, int start) {
        return buffer.getInt(start);
    }
}

Related

  1. decode(String charsetName, ByteBuffer byteBuffer)
  2. decodeAlign(ByteBuffer buf)
  3. decodeASCII(ByteBuffer buffer, int length, int offset)
  4. decodeBuffer(ByteBuffer buffer, String charsetName)
  5. decodeDouble(ByteBuffer bb)
  6. decodeIO(String encoding, ByteBuffer bbuf)
  7. decodeLength(ByteBuffer buf)
  8. decodeLong(ByteBuffer buffer, int start)
  9. decodeNIO(String encoding, ByteBuffer bbuf)