Package org.redline_rpm

Examples of org.redline_rpm.ReadableChannelWrapper


    int x = 0;
    for ( CpioHeader header : headers) {
      Object object = sources.get( header);
      String value = "";
      if ( object instanceof File) {
        final ReadableChannelWrapper input = new ReadableChannelWrapper( new FileInputStream(( File) object).getChannel());
        final Key< byte[]> key = input.start( "MD5");
        while ( input.read( buffer) != -1) buffer.rewind();
        value = Util.hex(input.finish(key));
        input.close();
      } else if ( object instanceof URL) {
        final ReadableChannelWrapper input = new ReadableChannelWrapper( Channels.newChannel((( URL) object).openConnection().getInputStream()));
        final Key< byte[]> key = input.start( "MD5");
        while ( input.read( buffer) != -1) buffer.rewind();
        value = Util.hex(input.finish(key));
        input.close();
      }
      array[ x++] = value;
    }
    return array;
  }
View Full Code Here


    assertNotNull( format.getSignature().getEntry( LEGACY_PGP));
  }

  private Format getFormat( File filename ) throws IOException {
    Scanner scanner = new Scanner();
    return scanner.run(new ReadableChannelWrapper( Channels
        .newChannel( new FileInputStream( filename ) )));
  }
View Full Code Here

TOP

Related Classes of org.redline_rpm.ReadableChannelWrapper

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.