langtools/src/share/classes/com/sun/tools/javac/file/ZipFileIndexArchive.java
changeset 8032 e1aa25ccdabb
parent 5847 1908176fd6e3
child 22159 682da512ec17
equal deleted inserted replaced
8031:d5fe2c1cecfc 8032:e1aa25ccdabb
     1 /*
     1 /*
     2  * Copyright (c) 2005, 2009, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
    40 import java.nio.charset.CharsetDecoder;
    40 import java.nio.charset.CharsetDecoder;
    41 
    41 
    42 import com.sun.tools.javac.file.JavacFileManager.Archive;
    42 import com.sun.tools.javac.file.JavacFileManager.Archive;
    43 import com.sun.tools.javac.file.RelativePath.RelativeDirectory;
    43 import com.sun.tools.javac.file.RelativePath.RelativeDirectory;
    44 import com.sun.tools.javac.file.RelativePath.RelativeFile;
    44 import com.sun.tools.javac.file.RelativePath.RelativeFile;
       
    45 import com.sun.tools.javac.util.Assert;
    45 import com.sun.tools.javac.util.List;
    46 import com.sun.tools.javac.util.List;
    46 
    47 
    47 /**
    48 /**
    48  * <p><b>This is NOT part of any supported API.
    49  * <p><b>This is NOT part of any supported API.
    49  * If you write code that depends on this, you do so at your own risk.
    50  * If you write code that depends on this, you do so at your own risk.
   144         }
   145         }
   145 
   146 
   146         @Override
   147         @Override
   147         public InputStream openInputStream() throws IOException {
   148         public InputStream openInputStream() throws IOException {
   148             if (inputStream == null) {
   149             if (inputStream == null) {
   149                 assert entry != null; // see constructor
   150                 Assert.checkNonNull(entry); // see constructor
   150                 inputStream = new ByteArrayInputStream(zfIndex.read(entry));
   151                 inputStream = new ByteArrayInputStream(zfIndex.read(entry));
   151             }
   152             }
   152             return inputStream;
   153             return inputStream;
   153         }
   154         }
   154 
   155