code: public static int getShortLength(ByteBuffer bb, int position)
      {
          int length = (bb.get(position) & 0xFF) << 8;
          return length | (bb.get(position + 1) & 0xFF);
      }
docs: Doesn't change bb position