Java File Read via ByteBuffer readUintLE(byte[] bytes, int pointer, int size)

Here you can find the source of readUintLE(byte[] bytes, int pointer, int size)

Description

read Uint LE

License

Open Source License

Declaration

public static long readUintLE(byte[] bytes, int pointer, int size) 

Method Source Code


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

import java.nio.ByteBuffer;
import java.nio.ByteOrder;

public class Main {
    public static long readUintLE(byte[] bytes, int pointer, int size) {
        ByteBuffer buffer = ByteBuffer.allocate(8);
        buffer.put(bytes, pointer, size);
        buffer.put(new byte[8 - size]);
        buffer.flip();/* w  w  w.j av  a  2s .c  o m*/
        return buffer.order(ByteOrder.LITTLE_ENDIAN).getLong();
    }
}

Related

  1. readToByteArray(String fname)
  2. readTwoByteInt(byte[] array, int start)
  3. readTxtFromFile(File file)
  4. readUint32(final DataInput di)
  5. readUint32AsInt(DataInput di)
  6. readUnsignedInt(InputStream is)
  7. readUnsignedInt24(InputStream is)
  8. readUtf8(DataInput in)
  9. readVarLong(byte[] arr)