private ClassFile toClassFile(ArchiveEntry entry) { final InputStream inputStream = entry.getStreamAccess().accessInputStream(); final DataInputStream dataInputStream = new DataInputStream( inputStream ); try { return new ClassFile( dataInputStream ); } catch (IOException e) { throw new ArchiveException( "Could not build ClassFile", e ); } finally { try { dataInputStream.close(); } catch (Exception ignore) { } try { inputStream.close(); } catch (IOException ignore) { } } }
public Binding bind(InputStreamAccess xmlInputStreamAccess) { LOG.tracef( "reading mappings from InputStreamAccess : %s", xmlInputStreamAccess.getStreamName() ); final Origin origin = new Origin( SourceType.INPUT_STREAM, xmlInputStreamAccess.getStreamName() ); InputStream xmlInputStream = xmlInputStreamAccess.accessInputStream(); try { return new InputStreamXmlSource( origin, xmlInputStream, false ).doBind( mappingBinder ); } finally { try { xmlInputStream.close(); } catch (IOException e) { LOG.debugf( "Unable to close InputStream obtained from InputStreamAccess : " + xmlInputStreamAccess.getStreamName() ); } } }
private ClassFile toClassFile(ArchiveEntry entry) { final InputStream inputStream = entry.getStreamAccess().accessInputStream(); final DataInputStream dataInputStream = new DataInputStream( inputStream ); try { return new ClassFile( dataInputStream ); } catch (IOException e) { throw new ArchiveException( "Could not build ClassFile", e ); } finally { try { dataInputStream.close(); } catch (Exception ignore) { } try { inputStream.close(); } catch (IOException ignore) { } } }
public Binding bind(InputStreamAccess xmlInputStreamAccess) { LOG.tracef( "reading mappings from InputStreamAccess : %s", xmlInputStreamAccess.getStreamName() ); final Origin origin = new Origin( SourceType.INPUT_STREAM, xmlInputStreamAccess.getStreamName() ); InputStream xmlInputStream = xmlInputStreamAccess.accessInputStream(); try { return new InputStreamXmlSource( origin, xmlInputStream, false ).doBind( mappingBinder ); } finally { try { xmlInputStream.close(); } catch (IOException e) { LOG.debugf( "Unable to close InputStream obtained from InputStreamAccess : " + xmlInputStreamAccess.getStreamName() ); } } }