private int dataRemaining(DataInput dataInput) {
    if (testJDK) {
      try {
        return ((java.io.DataInputStream) dataInput).available();
      } catch (IOException e) {
        throw new IllegalStateException(e);
      }
    } else {
      return ((ByteArrayDataInput) dataInput).available();
    }
  }
We want ByteArrayDataInput to behave like DataInputStream(ByteArrayInputStream).
This boolean allows us to switch back and forth in this test to make sure
they both behave the same. It should never be checked in with testJDK=true.
geode-serialization/src/test/java/org/apache/geode/internal/serialization/ByteArrayDataInputTest.java