Lines Matching refs:in

5  * you may not use this file except in compliance with the License.
10 * Unless required by applicable law or agreed to in writing, software
35 * Implements InputStream.read(int) in terms of InputStream.read(byte[], int, int).
39 public static int readSingleByte(InputStream in) throws IOException {
41 int result = in.read(buffer, 0, 1);
46 * Implements OutputStream.write(int) in terms of OutputStream.write(byte[], int, int).
57 * Fills 'dst' with bytes from 'in', throwing EOFException if insufficient bytes are available.
59 public static void readFully(InputStream in, byte[] dst) throws IOException {
60 readFully(in, dst, 0, dst.length);
64 * Reads exactly 'byteCount' bytes from 'in' (into 'dst' at offset 'offset'), and throws
69 public static void readFully(InputStream in, byte[] dst, int offset, int byteCount) throws IOException {
73 if (in == null) {
74 throw new NullPointerException("in == null");
81 int bytesRead = in.read(dst, offset, byteCount);
91 * Returns a byte[] containing the remainder of 'in', closing it when done.
93 public static byte[] readFully(InputStream in) throws IOException {
95 return readFullyNoClose(in);
97 in.close();
102 * Returns a byte[] containing the remainder of 'in'.
104 public static byte[] readFullyNoClose(InputStream in) throws IOException {
108 while ((count = in.read(buffer)) != -1) {
131 public static void skipAll(InputStream in) throws IOException {
133 in.skip(Long.MAX_VALUE);
134 } while (in.read() != -1);
138 * Skip <b>at most</b> {@code byteCount} bytes from {@code in} by calling read
146 * streams may call other streams in their skip() method, also clobbering the
149 public static long skipByReading(InputStream in, long byteCount) throws IOException {
159 int read = in.read(buffer, 0, toRead);
176 * Copies all of the bytes from {@code in} to {@code out}. Neither stream is closed.
179 public static int copy(InputStream in, OutputStream out) throws IOException {
183 while ((c = in.read(buffer)) != -1) {
197 public static String readAsciiLine(InputStream in) throws IOException {
202 int c = in.read();