MCPcopy
hub / github.com/google/guava / contentEquals

Method contentEquals

guava/src/com/google/common/io/ByteSource.java:349–361  ·  view source on GitHub ↗

Checks that the contents of this byte source are equal to the contents of the given byte source. @throws IOException if an I/O error occurs while reading from this source or {@code other}

(ByteSource other)

Source from the content-addressed store, hash-verified

347 * @throws IOException if an I/O error occurs while reading from this source or {@code other}
348 */
349 public boolean contentEquals(ByteSource other) throws IOException {
350 checkNotNull(other);
351
352 Closer closer = Closer.create();
353 try {
354 return ByteStreams.contentsEqual(
355 closer.register(openStream()), closer.register(other.openStream()));
356 } catch (Throwable e) {
357 throw closer.rethrow(e);
358 } finally {
359 closer.close();
360 }
361 }
362
363 /**
364 * Concatenates multiple {@link ByteSource} instances into a single source. Streams returned from

Callers 11

equalMethod · 0.95
equalMethod · 0.45
iterationOrderMethod · 0.45
testEqualMethod · 0.45
joinHelperMethod · 0.45
testEqualMethod · 0.45
testContentEqualsMethod · 0.45
testThresholdMethod · 0.45
testContentEqualsMethod · 0.45
isEqualsMethod · 0.45

Calls 7

createMethod · 0.95
contentsEqualMethod · 0.95
registerMethod · 0.95
openStreamMethod · 0.95
rethrowMethod · 0.95
closeMethod · 0.95
checkNotNullMethod · 0.45

Tested by 9

iterationOrderMethod · 0.36
testEqualMethod · 0.36
joinHelperMethod · 0.36
testEqualMethod · 0.36
testContentEqualsMethod · 0.36
testThresholdMethod · 0.36
testContentEqualsMethod · 0.36
isEqualsMethod · 0.36