Java tutorial
//package com.java2s; public class Main { private static final int INT8_LEN = Byte.SIZE; public static byte bytes2byte(byte[] data, int offset) { int len = INT8_LEN / INT8_LEN; if (data == null || data.length < offset + len) { throw new IllegalAccessError(); } return data[offset]; } }