ArrayType arrayType = new ArrayType(new ArrayType(StringType.INSTANCE));
BytesStreamOutput out = new BytesStreamOutput();
DataTypes.toStream(arrayType, out);
BytesStreamInput in = new BytesStreamInput(out.bytes());
DataType readType = DataTypes.fromStream(in);
assertThat(readType, instanceOf(ArrayType.class));
ArrayType readArrayType = (ArrayType)readType;