Source:
<code>public static byte[] createModuleAAD(byte[] fileAAD, ModuleType moduleType, int rowGroupOrdinal, int columnOrdinal, int pageOrdinal) { byte[] typeOrdinalBytes = new byte[1]; typeOrdinalBytes[0] = moduleType.getValue(); if (ModuleType.Footer == moduleType) { return concatByteArrays(fileAAD, typeOrdinalBytes); } if (rowGroupOrdinal < 0) { throw new IllegalArgumentException("Wrong row group ordinal: " + rowGroupOrdinal); } short shortRGOrdinal = (short) rowGroupOrdinal; if (shortRGOrdinal != rowGroupOrdinal) { throw new ParquetCryptoRuntimeException("Encrypted parquet files can't have " <START> + "more than Short.MAX_VALUE row groups: " + rowGroupOrdinal); <END> } byte[] rowGroupOrdinalBytes = shortToBytesLE(shortRGOrdinal); if (columnOrdinal < 0) { throw new IllegalArgumentException("Wrong column ordinal: " + columnOrdinal); } short shortColumOrdinal = (short) columnOrdinal; if (shortColumOrdinal != columnOrdinal) { throw new ParquetCryptoRuntimeException("Encrypted parquet files can't have " + "more than Short.MAX_VALUE columns: " + columnOrdinal); } byte[] columnOrdinalBytes = shortToBytesLE(shortColumOrdinal); if (ModuleType.DataPage != moduleType && ModuleType.DataPageHeader != moduleType) { return concatByteArrays(fileAAD, typeOrdinalBytes, rowGroupOrdinalBytes, columnOrdinalBytes); } if (pageOrdinal < 0) { throw new IllegalArgumentException("Wrong page ordinal: " + pageOrdinal); } short shortPageOrdinal = (short) pageOrdinal; if (shortPageOrdinal != pageOrdinal) { throw new ParquetCryptoRuntimeException("Encrypted parquet files can't have " + "more than Short.MAX_VALUE pages per chunk: " + pageOrdinal); } byte[] pageOrdinalBytes = shortToBytesLE(shortPageOrdinal); return concatByteArrays(fileAAD, typeOrdinalBytes, rowGroupOrdinalBytes, columnOrdinalBytes, pageOrdinalBytes); }</code><technical_language>I think, writing actual instead of referencing a java constant is more informative</technical_language>

Target:
public static byte[] createModuleAAD(byte[] fileAAD, ModuleType moduleType, int rowGroupOrdinal, int columnOrdinal, int pageOrdinal) { byte[] typeOrdinalBytes = new byte[1]; typeOrdinalBytes[0] = moduleType.getValue(); if (ModuleType.Footer == moduleType) { return concatByteArrays(fileAAD, typeOrdinalBytes); } if (rowGroupOrdinal < 0) { throw new IllegalArgumentException("Wrong row group ordinal: " + rowGroupOrdinal); } short shortRGOrdinal = (short) rowGroupOrdinal; if (shortRGOrdinal != rowGroupOrdinal) { throw new ParquetCryptoRuntimeException("Encrypted parquet files can't have " + "more than " + Short.MAX_VALUE + " row groups: " + rowGroupOrdinal); } byte[] rowGroupOrdinalBytes = shortToBytesLE(shortRGOrdinal); if (columnOrdinal < 0) { throw new IllegalArgumentException("Wrong column ordinal: " + columnOrdinal); } short shortColumOrdinal = (short) columnOrdinal; if (shortColumOrdinal != columnOrdinal) { throw new ParquetCryptoRuntimeException("Encrypted parquet files can't have " + "more than " + Short.MAX_VALUE + " columns: " + columnOrdinal); } byte[] columnOrdinalBytes = shortToBytesLE(shortColumOrdinal); if (ModuleType.DataPage != moduleType && ModuleType.DataPageHeader != moduleType) { return concatByteArrays(fileAAD, typeOrdinalBytes, rowGroupOrdinalBytes, columnOrdinalBytes); } if (pageOrdinal < 0) { throw new IllegalArgumentException("Wrong page ordinal: " + pageOrdinal); } short shortPageOrdinal = (short) pageOrdinal; if (shortPageOrdinal != pageOrdinal) { throw new ParquetCryptoRuntimeException("Encrypted parquet files can't have " + "more than " + Short.MAX_VALUE + " pages per chunk: " + pageOrdinal); } byte[] pageOrdinalBytes = shortToBytesLE(shortPageOrdinal); return concatByteArrays(fileAAD, typeOrdinalBytes, rowGroupOrdinalBytes, columnOrdinalBytes, pageOrdinalBytes); }