public static void writeCharArray(char[] array, DataOutput out) throws IOException {
    checkOut(out);

    if (array == null) {
      writeArrayLength(-1, out);
    } else {
      final int length = array.length;
      if (logger.isTraceEnabled(LogMarker.SERIALIZER_VERBOSE)) {
        logger.trace(LogMarker.SERIALIZER_VERBOSE, "Writing char array of length {}", length);
      }
      writeArrayLength(length, out);
      for (char character : array) {
        out.writeChar(character);
      }
    }
  }
Writes given number of characters from array of {@code char}s to a {@code DataOutput}.

@throws IOException A problem occurs while writing to {@code out}
@see DataSerializer#readCharArray
@since GemFire 6.6
geode-core/src/main/java/org/apache/geode/internal/InternalDataSerializer.java