static ZipInputStream createZipInputStream ( InputStream inStream , Charset charset ) { if ( charset == null ) return new ZipInputStream ( inStream ) ; try { Constructor < ZipInputStream > constructor = ZipInputStream . class . getConstructor ( new Class [ ] { InputStream . class , Charset . class } ) ; return ( ZipInputStream ) constructor . newInstance ( new Object [ ] { inStream , charset } ) ; } catch ( NoSuchMethodException e ) { throw new IllegalStateException ( MISSING_METHOD_PLEASE_UPGRADE , e ) ; } catch ( InstantiationException e ) { throw new IllegalStateException ( CONSTRUCTOR_MESSAGE_FOR_INPUT + e . getMessage ( ) , e ) ; } catch ( IllegalAccessException e ) { throw new IllegalStateException ( CONSTRUCTOR_MESSAGE_FOR_INPUT + e . getMessage ( ) , e ) ; } catch ( IllegalArgumentException e ) { throw new IllegalStateException ( CONSTRUCTOR_MESSAGE_FOR_INPUT + e . getMessage ( ) , e ) ; } catch ( InvocationTargetException e ) { throw new IllegalStateException ( CONSTRUCTOR_MESSAGE_FOR_INPUT + e . getMessage ( ) , e ) ; } }
Returns a ZipInputStream opened with a given charset .