本文整理了Java中org.codehaus.plexus.util.IOUtil.contentEquals()
方法的一些代码示例,展示了IOUtil.contentEquals()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。IOUtil.contentEquals()
方法的具体详情如下:
包路径:org.codehaus.plexus.util.IOUtil
类名称:IOUtil
方法名:contentEquals
[英]Compare the contents of two Streams to determine if they are equal or not.
[中]比较两个流的内容以确定它们是否相等。
代码示例来源:origin: org.codehaus.plexus/plexus-utils
equals = IOUtil.contentEquals( input1, input2 );
input1.close();
input1 = null;
代码示例来源:origin: eclipse/tycho
@Override
public ArtifactDelta getDelta(InputStream baseline, InputStream reactor, MojoExecution mojo) throws IOException {
return !IOUtil.contentEquals(baseline, reactor) ? new SimpleArtifactDelta("different") : null;
}
代码示例来源:origin: m2e-code-quality/m2e-code-quality
protected void copyIfChanged(InputStream input, Path output) throws IOException {
InputStream source = input;
if (Files.exists(output)) {
byte[] fileContent = IOUtil.toByteArray(input);
ByteArrayInputStream bufferedInput = new ByteArrayInputStream(fileContent);
// compare content first
try (InputStream outputContent = Files.newInputStream(output)) {
if (IOUtil.contentEquals(bufferedInput, outputContent)) {
return;
}
}
// rewind input and use it
bufferedInput.reset();
source = bufferedInput;
}
Files.copy(source, output, StandardCopyOption.REPLACE_EXISTING);
}
代码示例来源:origin: org.apache.servicemix.kernel.gshell/org.apache.servicemix.kernel.gshell.core
return IOUtil.contentEquals( input1, input2 );
代码示例来源:origin: torquebox/jruby-maven-plugins
.getContextClassLoader()
.getResourceAsStream("boot.rb.orig");
if (IOUtil.contentEquals(bootIn, bootOrig)) {
bootIn.close();
bootOut = new FileOutputStream(boot);
内容来源于网络,如有侵权,请联系作者删除!