< prev index next >

src/java.base/share/classes/java/io/FileInputStream.java

Print this page

        

*** 238,248 **** * @param b the data to be written * @param off the start offset in the data * @param len the number of bytes that are written * @exception IOException If an I/O error has occurred. */ ! private native int readBytes(byte b[], int off, int len) throws IOException; /** * Reads up to <code>b.length</code> bytes of data from this input * stream into an array of bytes. This method blocks until some input * is available. --- 238,248 ---- * @param b the data to be written * @param off the start offset in the data * @param len the number of bytes that are written * @exception IOException If an I/O error has occurred. */ ! private native int readBytes(byte[] b, int off, int len) throws IOException; /** * Reads up to <code>b.length</code> bytes of data from this input * stream into an array of bytes. This method blocks until some input * is available.
*** 251,261 **** * @return the total number of bytes read into the buffer, or * <code>-1</code> if there is no more data because the end of * the file has been reached. * @exception IOException if an I/O error occurs. */ ! public int read(byte b[]) throws IOException { return readBytes(b, 0, b.length); } /** * Reads up to <code>len</code> bytes of data from this input stream --- 251,261 ---- * @return the total number of bytes read into the buffer, or * <code>-1</code> if there is no more data because the end of * the file has been reached. * @exception IOException if an I/O error occurs. */ ! public int read(byte[] b) throws IOException { return readBytes(b, 0, b.length); } /** * Reads up to <code>len</code> bytes of data from this input stream
*** 273,283 **** * @exception IndexOutOfBoundsException If <code>off</code> is negative, * <code>len</code> is negative, or <code>len</code> is greater than * <code>b.length - off</code> * @exception IOException if an I/O error occurs. */ ! public int read(byte b[], int off, int len) throws IOException { return readBytes(b, off, len); } /** * Skips over and discards <code>n</code> bytes of data from the --- 273,283 ---- * @exception IndexOutOfBoundsException If <code>off</code> is negative, * <code>len</code> is negative, or <code>len</code> is greater than * <code>b.length - off</code> * @exception IOException if an I/O error occurs. */ ! public int read(byte[] b, int off, int len) throws IOException { return readBytes(b, off, len); } /** * Skips over and discards <code>n</code> bytes of data from the
< prev index next >