1 /* |
1 /* |
2 * Copyright (c) 1994, 2006, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1994, 2016, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
148 public final int read(byte b[], int off, int len) throws IOException { |
148 public final int read(byte b[], int off, int len) throws IOException { |
149 return in.read(b, off, len); |
149 return in.read(b, off, len); |
150 } |
150 } |
151 |
151 |
152 /** |
152 /** |
153 * See the general contract of the <code>readFully</code> |
153 * See the general contract of the {@code readFully} |
154 * method of <code>DataInput</code>. |
154 * method of {@code DataInput}. |
155 * <p> |
155 * <p> |
156 * Bytes |
156 * Bytes |
157 * for this operation are read from the contained |
157 * for this operation are read from the contained |
158 * input stream. |
158 * input stream. |
159 * |
159 * |
160 * @param b the buffer into which the data is read. |
160 * @param b the buffer into which the data is read. |
161 * @exception EOFException if this input stream reaches the end before |
161 * @throws NullPointerException if {@code b} is {@code null}. |
162 * reading all the bytes. |
162 * @throws EOFException if this input stream reaches the end before |
163 * @exception IOException the stream has been closed and the contained |
163 * reading all the bytes. |
164 * input stream does not support reading after close, or |
164 * @throws IOException the stream has been closed and the contained |
165 * another I/O error occurs. |
165 * input stream does not support reading after close, or |
166 * @see java.io.FilterInputStream#in |
166 * another I/O error occurs. |
|
167 * @see java.io.FilterInputStream#in |
167 */ |
168 */ |
168 public final void readFully(byte b[]) throws IOException { |
169 public final void readFully(byte b[]) throws IOException { |
169 readFully(b, 0, b.length); |
170 readFully(b, 0, b.length); |
170 } |
171 } |
171 |
172 |
172 /** |
173 /** |
173 * See the general contract of the <code>readFully</code> |
174 * See the general contract of the {@code readFully} |
174 * method of <code>DataInput</code>. |
175 * method of {@code DataInput}. |
175 * <p> |
176 * <p> |
176 * Bytes |
177 * Bytes |
177 * for this operation are read from the contained |
178 * for this operation are read from the contained |
178 * input stream. |
179 * input stream. |
179 * |
180 * |
180 * @param b the buffer into which the data is read. |
181 * @param b the buffer into which the data is read. |
181 * @param off the start offset of the data. |
182 * @param off the start offset in the data array {@code b}. |
182 * @param len the number of bytes to read. |
183 * @param len the number of bytes to read. |
183 * @exception EOFException if this input stream reaches the end before |
184 * @exception NullPointerException if {@code b} is {@code null}. |
184 * reading all the bytes. |
185 * @exception IndexOutOfBoundsException if {@code off} is negative, |
|
186 * {@code len} is negative, or {@code len} is greater than |
|
187 * {@code b.length - off}. |
|
188 * @exception EOFException if this input stream reaches the end before |
|
189 * reading all the bytes. |
185 * @exception IOException the stream has been closed and the contained |
190 * @exception IOException the stream has been closed and the contained |
186 * input stream does not support reading after close, or |
191 * input stream does not support reading after close, or |
187 * another I/O error occurs. |
192 * another I/O error occurs. |
188 * @see java.io.FilterInputStream#in |
193 * @see java.io.FilterInputStream#in |
189 */ |
194 */ |