| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static int | Returns: number of bytes actually read.channel to read data from. channel, byte[] buffer that must be fully populated, [off, off+len). dst, int position within the buffer to start writing to. off, int number of bytes that should be read. len)Read as much of the array as possible from a channel. |
| public static final byte[] | |
| public static final byte[] | |
| public static void | readFully(final InputStream
input stream to read the data from. fd, final byte[] buffer that must be fully populated, [off, off+len). dst, int position within the buffer to start writing to. off, int number of bytes that must be read. len)Read the entire byte array into memory, or throw an exception. |
| public static void | readFully(InputStream
input stream to read the data from. fd, byte[] buffer that must be fully populated dst)Read from input until the entire byte array filled, or throw an exception if stream ends first. |
| public static int | Returns: number of bytes readinput stream to read the data from. fd, byte[] buffer that must be fully populated, [off, off+len). dst, int position within the buffer to start writing to. off)Read the entire byte array into memory, unless input is shorter |
| public static String | |
| public static List | |
| public static final byte[] | Returns: complete contents of the requested local file. If the contents exceeds the limit, then only the limit is returned.location of the file to read. path, int maximum number of bytes to read, if the file is larger than
only the first limit number of bytes are returned limit)Read at most limit bytes from the local file into memory as a byte array. |
| public static ByteBuffer | Returns: complete contents of the input stream. The ByteBuffer always has a writable backing array, withposition() == 0 and
limit() equal to the actual length read. Callers may rely
on obtaining the underlying array for efficient data access. If
sizeHint was too large, the array may be over-allocated,
resulting in limit() < array().length.input stream to be read. in, int a hint on the approximate number of bytes contained in the
stream, used to allocate temporary buffers more efficiently sizeHint)Read an entire input stream into memory as a ByteBuffer. |
| private static void | |
| public static void | skipFully(InputStream
the stream to skip bytes from. fd, long total number of bytes to be discarded. Must be >= 0. toSkip)Skip an entire region of an input stream. |
| IO | back to summary |
|---|---|
| private IO() | |
| read | back to summary |
|---|---|
| public static int read(ReadableByteChannel channel, byte[] dst, int off, int len) throws IOException Read as much of the array as possible from a channel.
| |
| readFully | back to summary |
|---|---|
| public static final byte[] readFully(File path) throws FileNotFoundException, IOException Read an entire local file into memory as a byte array.
| |
| readFully | back to summary |
|---|---|
| public static final byte[] readFully(File path, int max) throws FileNotFoundException, IOException Read an entire local file into memory as a byte array.
| |
| readFully | back to summary |
|---|---|
| public static void readFully(final InputStream fd, final byte[] dst, int off, int len) throws IOException Read the entire byte array into memory, or throw an exception.
| |
| readFully | back to summary |
|---|---|
| public static void readFully(InputStream fd, byte[] dst) throws IOException Read from input until the entire byte array filled, or throw an exception if stream ends first.
| |
| readFully | back to summary |
|---|---|
| public static int readFully(InputStream fd, byte[] dst, int off) throws IOException Read the entire byte array into memory, unless input is shorter
| |
| readLine | back to summary |
|---|---|
| public static String readLine(Reader in, int sizeHint) throws IOException Read the next line from a reader.
Like
| |
| readLines | back to summary |
|---|---|
| public static List Divides the given string into lines. | |
| readSome | back to summary |
|---|---|
| public static final byte[] readSome(File path, int limit) throws FileNotFoundException, IOException Read at most limit bytes from the local file into memory as a byte array.
| |
| readWholeStream | back to summary |
|---|---|
| public static ByteBuffer readWholeStream(InputStream in, int sizeHint) throws IOException Read an entire input stream into memory as a ByteBuffer. Note The stream is read to its end and is not usable after calling this method. The caller is responsible for closing the stream.
| |
| resetAndSkipFully | back to summary |
|---|---|
| private static void resetAndSkipFully(Reader fd, long toSkip) throws IOException | |
| skipFully | back to summary |
|---|---|
| public static void skipFully(InputStream fd, long toSkip) throws IOException Skip an entire region of an input stream. The input stream's position is moved forward by the number of requested bytes, discarding them from the input. This method does not return until the exact number of bytes requested has been skipped.
| |