docs/javadoc/reference/com/facebook/common/internal/ByteStreams.html
|
|
ImmutableMap<K, V>
ImmutableSet<E>
Summary: Methods | Inherited Methods | [Expand All]
public final class
extends Object
| java.lang.Object | | ↳ | com.facebook.common.internal.ByteStreams |
Provides utility methods for working with byte arrays and I/O streams.
| Public Methods |
|---|
| static long |
| Copies all bytes from the input stream to the output stream. |
| static int |
Reads some bytes from an input stream and stores them into the buffer array b. |
| static void |
Attempts to read len bytes from the stream into the given array starting at off, with the same behavior as readFully(byte[], int, int). |
| static byte[] |
| Reads all bytes from an input stream into a byte array. |
| static byte[] |
| Reads all bytes from an input stream into a byte array. |
| [Expand] Inherited Methods | | --- | | From class java.lang.Object
| Object | clone() | | boolean | equals(Object arg0) | | void | finalize() | | final Class<?> | getClass() | | int | hashCode() | | final void | notify() | | final void | notifyAll() | | String | toString() | | final void | wait(long arg0, int arg1) | | final void | wait(long arg0) | | final void | wait() |
|
Copies all bytes from the input stream to the output stream. Does not close or flush either stream.
| from | the input stream to read from | | to | the output stream to write to |
| IOException | if an I/O error occurs |
Reads some bytes from an input stream and stores them into the buffer array b. This method blocks until len bytes of input data have been read into the array, or end of file is detected. The number of bytes read is returned, possibly zero. Does not close the stream.
A caller can detect EOF if the number of bytes read is less than len. All subsequent calls on the same stream will return zero.
If b is null, a NullPointerException is thrown. If off is negative, or len is negative, or off+len is greater than the length of the array b, then an IndexOutOfBoundsException is thrown. If len is zero, then no bytes are read. Otherwise, the first byte read is stored into element b[off], the next one into b[off+1], and so on. The number of bytes read is, at most, equal to len.
| in | the input stream to read from | | b | the buffer into which the data is read | | off | an int specifying the offset into the data | | len | an int specifying the number of bytes to read |
| IOException | if an I/O error occurs |
Attempts to read len bytes from the stream into the given array starting at off, with the same behavior as readFully(byte[], int, int). Does not close the stream.
| in | the input stream to read from. | | b | the buffer into which the data is read. | | off | an int specifying the offset into the data. | | len | an int specifying the number of bytes to read. |
| EOFException | if this stream reaches the end before reading all the bytes. | | IOException | if an I/O error occurs. |
Reads all bytes from an input stream into a byte array. The given expected size is used to create an initial byte array, but if the actual number of bytes read from the stream differs, the correct result will be returned anyway.
| IOException | |
Reads all bytes from an input stream into a byte array. Does not close the stream.
| in | the input stream to read from |
| IOException | if an I/O error occurs |
<!-- ========= METHOD DETAIL ======== --><!-- ========= END OF CLASS DATA ========= -->+Generated by Doclava. +
<!-- end footer - @generated --> <!-- jd-content --> <!-- end doc-content --> <!-- end body-content -->