byte [] data = { 00, 11, 22, 33, 44 }; ByteBuffer bb = ByteBuffer.wrap(data); // Create the ByteBuffer byte b; for (;;) { try { // Call get() until EOF b = bb.get(); } catch(Exception) { // EOF break; } }OK maybe that's not the best example. But you get the idea. If you just want to look thru a byte array do this:
for (byte b : data) { }