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

Method wrap

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

Returns a view of the given byte array as a {@link ByteSource}. To view only a specific range in the array, use {@code ByteSource.wrap(b).slice(offset, length)}. <p>Note that the given byte array may be passed directly to methods on, for example, {@code OutputStream} (when {@code copyTo(OutputStrea

(byte[] b)

Source from the content-addressed store, hash-verified

425 * @since 15.0 (since 14.0 as {@code ByteStreams.asByteSource(byte[])}).
426 */
427 public static ByteSource wrap(byte[] b) {
428 return new ByteArrayByteSource(b);
429 }
430
431 /**
432 * Returns an immutable {@link ByteSource} that contains no bytes.

Callers 13

setUpMethod · 0.95
testThresholdMethod · 0.95
createSourceMethod · 0.95
testConcatMethod · 0.95
newNormalByteSourceMethod · 0.95
growMethod · 0.45
copyMethod · 0.45
putBytesMethod · 0.45
makeHashMethod · 0.45
getCoercedIPv4AddressMethod · 0.45
fromByteArrayMethod · 0.45

Calls

no outgoing calls

Tested by 7

setUpMethod · 0.76
testThresholdMethod · 0.76
createSourceMethod · 0.76
testConcatMethod · 0.76
newNormalByteSourceMethod · 0.76
copyMethod · 0.36