@@ -0,0 +1,1854 @@
+/*%0A * Copyright (c) 1998-2019 University Corporation for Atmospheric Research/Unidata%0A * See LICENSE for license information.%0A */%0Apackage ucar.nc2;%0A%0Aimport java.io.IOException;%0Aimport org.junit.After;%0Aimport org.junit.Assert;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0Aimport org.junit.experimental.categories.Category;%0Aimport software.amazon.awssdk.regions.Region;%0Aimport ucar.ma2.Array;%0Aimport ucar.nc2.iosp.nexrad2.Nexrad2IOServiceProvider;%0Aimport ucar.unidata.util.test.category.NeedsExternalResource;%0A%0A@Category(NeedsExternalResource.class)%0Apublic class TestS3ExternalCompressionRead %7B%0A%0A  @Before()%0A  public void registerLevel2Iosp() throws InstantiationException, IllegalAccessException %7B%0A    NetcdfFiles.registerIOProvider(ucar.nc2.iosp.nexrad2.Nexrad2IOServiceProvider.class);%0A  %7D%0A%0A  @Test%0A  public void testCompressedObjectRead() throws IOException %7B%0A    String region = Region.US_EAST_1.toString();%0A    String bucket = %22noaa-nexrad-level2%22;%0A    String key = %221991/07/20/KTLX/KTLX19910720_160529.gz%22;%0A    String s3uri = %22s3://%22 + bucket + %22/%22 + key;%0A%0A    System.setProperty(%22aws.region%22, region);%0A    try (NetcdfFile ncfile = NetcdfFiles.open(s3uri)) %7B%0A%0A      Assert.assertNotNull(ncfile.findDimension(%22scanR%22));%0A      Assert.assertNotNull(ncfile.findDimension(%22gateR%22));%0A      Assert.assertNotNull(ncfile.findDimension(%22radialR%22));%0A%0A      Variable radiance = ncfile.findVariable(%22Rad%22);%0A      Variable reflectivity = ncfile.findVariable(%22Reflectivity%22);%0A      Assert.assertNotNull(reflectivity);%0A%0A      // read array%0A      Array array = reflectivity.read();%0A%0A      Assert.assertEquals(array.getRank(), 3);%0A%0A      int%5B%5D shape = array.getShape();%0A      Assert.assertEquals(shape%5B0%5D, 1);%0A      Assert.assertEquals(shape%5B1%5D, 366);%0A      Assert.assertEquals(shape%5B2%5D, 460);%0A    %7D finally %7B%0A      System.clearProperty(%22aws.region%22);%0A    %7D%0A  %7D%0A%7D%0A

Add S3 compressed object test