AesGcmOutputFile.java org::apache::iceberg::encryption::AesGcmOutputFile org::apache::iceberg::encryption /* *LicensedtotheApacheSoftwareFoundation(ASF)underone *ormorecontributorlicenseagreements.SeetheNOTICEfile *distributedwiththisworkforadditionalinformation *regardingcopyrightownership.TheASFlicensesthisfile *toyouundertheApacheLicense,Version2.0(the *"License");youmaynotusethisfileexceptincompliance *withtheLicense.YoumayobtainacopyoftheLicenseat * *http://www.apache.org/licenses/LICENSE-2.0 * *Unlessrequiredbyapplicablelaworagreedtoinwriting, *softwaredistributedundertheLicenseisdistributedonan *"ASIS"BASIS,WITHOUTWARRANTIESORCONDITIONSOFANY *KIND,eitherexpressorimplied.SeetheLicenseforthe *specificlanguagegoverningpermissionsandlimitations *undertheLicense. */ packageorg.apache.iceberg.encryption; importorg.apache.iceberg.io.InputFile; importorg.apache.iceberg.io.OutputFile; importorg.apache.iceberg.io.PositionOutputStream; publicclassAesGcmOutputFileimplementsOutputFile{ privatefinalOutputFiletargetFile; privatefinalbyte[]dataKey; privatefinalbyte[]fileAADPrefix; publicAesGcmOutputFile(OutputFiletargetFile,byte[]dataKey,byte[]fileAADPrefix){ this.targetFile=targetFile; this.dataKey=dataKey; this.fileAADPrefix=fileAADPrefix; } @Override publicPositionOutputStreamcreate(){ returnnewAesGcmOutputStream(targetFile.create(),dataKey,fileAADPrefix); } @Override publicPositionOutputStreamcreateOrOverwrite(){ returnnewAesGcmOutputStream(targetFile.createOrOverwrite(),dataKey,fileAADPrefix); } @Override publicStringlocation(){ returntargetFile.location(); } @Override publicInputFiletoInputFile(){ returnnewAesGcmInputFile(targetFile.toInputFile(),dataKey,fileAADPrefix); } }