private int readByteAsInt() {
    if (pos >= nBytes) {
      return -1;
    } else {
      return bytes[pos++] & 0xff;
    }
  }
Behaves like InputStream.read()
Returns the next byte as an int in the range [0..255]
or -1 if at EOF.
geode-serialization/src/main/java/org/apache/geode/internal/serialization/ByteArrayDataInput.java