Java tutorial
//package com.java2s; import java.nio.ByteBuffer; public class Main { public static int getTypeNew(ByteBuffer buf) { int type = -1; if (buf != null && buf.capacity() > 11) { type = buf.get(11); } return type; } }