Java ByteBuffer to Int readInt(ByteBuffer buffer)

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

Description

read Int

License

Open Source License

Declaration

public static int readInt(ByteBuffer buffer) throws IOException 

Method Source Code


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

import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;

public class Main {
    public static int readInt(ByteBuffer buffer) throws IOException {
        buffer.order(ByteOrder.LITTLE_ENDIAN);
        int value = buffer.getInt();
        buffer.order(ByteOrder.BIG_ENDIAN);
        return value;
    }/*  w w  w . ja  v a2s.  com*/
}

Related

  1. getUShort(ByteBuffer buffer)
  2. getUShort(java.nio.ByteBuffer buffer)
  3. readInt(ByteBuffer buf)
  4. readInt(ByteBuffer buf, int length)
  5. readInt(ByteBuffer buf, int pos)
  6. readInt(ByteBuffer buffer)
  7. readInt(ReadableByteChannel channel, ByteBuffer buffer)
  8. readInt16(ByteBuffer bb)
  9. readInt32(ByteBuffer bb)