Java tutorial
//package com.java2s; import android.graphics.Rect; import java.nio.ByteBuffer; import java.nio.ByteOrder; public class Main { private static Rect getRectByByte(byte[] org) { Rect rect = new Rect(); ByteBuffer byteBuffer = ByteBuffer.wrap(org).order(ByteOrder.nativeOrder()); rect.set(byteBuffer.getInt(3 * 4), byteBuffer.getInt(5 * 4), byteBuffer.getInt(4 * 4), byteBuffer.getInt(6 * 4)); return rect; } }