public static boolean[] readBooleanArray(DataInput in) throws IOException {

    InternalDataSerializer.checkIn(in);

    int length = InternalDataSerializer.readArrayLength(in);
    if (length == -1) {
      return null;
    } else {
      boolean[] array = new boolean[length];
      for (int i = 0; i < length; i++) {
        array[i] = in.readBoolean();
      }

      if (logger.isTraceEnabled(LogMarker.SERIALIZER_VERBOSE)) {
        logger.trace(LogMarker.SERIALIZER_VERBOSE, "Read boolean array of length {}", length);
      }

      return array;
    }
  }
Reads an array of <code>boolean</code>s from a <code>DataInput</code>.

@param in the {@link DataInput} to read from
@return the deserialized array of <code>boolean</code>s

@throws IOException A problem occurs while reading from <code>in</code>

@see #writeBooleanArray
@since GemFire 5.7
geode-core/src/main/java/org/apache/geode/DataSerializer.java