View Javadoc
1   /*
2    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
3    * The software in this package is published under the terms of the CPAL v1.0
4    * license, a copy of which has been included with this distribution in the
5    * LICENSE.txt file.
6    */
7   package org.mule.util.scan.annotations;
8   
9   import java.io.IOException;
10  import java.io.InputStream;
11  
12  import org.objectweb.asm.ClassReader;
13  
14  /**
15   * A Class reader trhat will close the stream once initialised
16   */
17  public class ClosableClassReader extends ClassReader
18  {
19      public ClosableClassReader(String s) throws IOException
20      {
21          super(s);
22      }
23  
24      public ClosableClassReader(InputStream inputStream) throws IOException
25      {
26            super(inputStream);
27            inputStream.close();
28      }
29  }