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)
| 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. |
no outgoing calls