< prev index next >
src/java.base/share/classes/java/io/DataInputStream.java
Print this page
*** 53,64 ****
}
/**
* working arrays initialized on demand by readUTF
*/
! private byte bytearr[] = new byte[80];
! private char chararr[] = new char[80];
/**
* Reads some number of bytes from the contained input stream and
* stores them into the buffer array <code>b</code>. The number of
* bytes actually read is returned as an integer. This method blocks
--- 53,64 ----
}
/**
* working arrays initialized on demand by readUTF
*/
! private byte[] bytearr = new byte[80];
! private char[] chararr = new char[80];
/**
* Reads some number of bytes from the contained input stream and
* stores them into the buffer array <code>b</code>. The number of
* bytes actually read is returned as an integer. This method blocks
*** 94,104 ****
* input stream does not support reading after close, or another I/O
* error occurs.
* @see java.io.FilterInputStream#in
* @see java.io.InputStream#read(byte[], int, int)
*/
! public final int read(byte b[]) throws IOException {
return in.read(b, 0, b.length);
}
/**
* Reads up to <code>len</code> bytes of data from the contained
--- 94,104 ----
* input stream does not support reading after close, or another I/O
* error occurs.
* @see java.io.FilterInputStream#in
* @see java.io.InputStream#read(byte[], int, int)
*/
! public final int read(byte[] b) throws IOException {
return in.read(b, 0, b.length);
}
/**
* Reads up to <code>len</code> bytes of data from the contained
*** 143,153 ****
* input stream does not support reading after close, or another I/O
* error occurs.
* @see java.io.FilterInputStream#in
* @see java.io.InputStream#read(byte[], int, int)
*/
! public final int read(byte b[], int off, int len) throws IOException {
return in.read(b, off, len);
}
/**
* See the general contract of the {@code readFully}
--- 143,153 ----
* input stream does not support reading after close, or another I/O
* error occurs.
* @see java.io.FilterInputStream#in
* @see java.io.InputStream#read(byte[], int, int)
*/
! public final int read(byte[] b, int off, int len) throws IOException {
return in.read(b, off, len);
}
/**
* See the general contract of the {@code readFully}
*** 164,174 ****
* @throws IOException the stream has been closed and the contained
* input stream does not support reading after close, or
* another I/O error occurs.
* @see java.io.FilterInputStream#in
*/
! public final void readFully(byte b[]) throws IOException {
readFully(b, 0, b.length);
}
/**
* See the general contract of the {@code readFully}
--- 164,174 ----
* @throws IOException the stream has been closed and the contained
* input stream does not support reading after close, or
* another I/O error occurs.
* @see java.io.FilterInputStream#in
*/
! public final void readFully(byte[] b) throws IOException {
readFully(b, 0, b.length);
}
/**
* See the general contract of the {@code readFully}
*** 190,200 ****
* @exception IOException the stream has been closed and the contained
* input stream does not support reading after close, or
* another I/O error occurs.
* @see java.io.FilterInputStream#in
*/
! public final void readFully(byte b[], int off, int len) throws IOException {
if (len < 0)
throw new IndexOutOfBoundsException();
int n = 0;
while (n < len) {
int count = in.read(b, off + n, len - n);
--- 190,200 ----
* @exception IOException the stream has been closed and the contained
* input stream does not support reading after close, or
* another I/O error occurs.
* @see java.io.FilterInputStream#in
*/
! public final void readFully(byte[] b, int off, int len) throws IOException {
if (len < 0)
throw new IndexOutOfBoundsException();
int n = 0;
while (n < len) {
int count = in.read(b, off + n, len - n);
*** 396,406 ****
if ((ch1 | ch2 | ch3 | ch4) < 0)
throw new EOFException();
return ((ch1 << 24) + (ch2 << 16) + (ch3 << 8) + (ch4 << 0));
}
! private byte readBuffer[] = new byte[8];
/**
* See the general contract of the <code>readLong</code>
* method of <code>DataInput</code>.
* <p>
--- 396,406 ----
if ((ch1 | ch2 | ch3 | ch4) < 0)
throw new EOFException();
return ((ch1 << 24) + (ch2 << 16) + (ch3 << 8) + (ch4 << 0));
}
! private byte[] readBuffer = new byte[8];
/**
* See the general contract of the <code>readLong</code>
* method of <code>DataInput</code>.
* <p>
*** 471,481 ****
*/
public final double readDouble() throws IOException {
return Double.longBitsToDouble(readLong());
}
! private char lineBuffer[];
/**
* See the general contract of the <code>readLine</code>
* method of <code>DataInput</code>.
* <p>
--- 471,481 ----
*/
public final double readDouble() throws IOException {
return Double.longBitsToDouble(readLong());
}
! private char[] lineBuffer;
/**
* See the general contract of the <code>readLine</code>
* method of <code>DataInput</code>.
* <p>
*** 502,512 ****
* @see java.io.BufferedReader#readLine()
* @see java.io.FilterInputStream#in
*/
@Deprecated
public final String readLine() throws IOException {
! char buf[] = lineBuffer;
if (buf == null) {
buf = lineBuffer = new char[128];
}
--- 502,512 ----
* @see java.io.BufferedReader#readLine()
* @see java.io.FilterInputStream#in
*/
@Deprecated
public final String readLine() throws IOException {
! char[] buf = lineBuffer;
if (buf == null) {
buf = lineBuffer = new char[128];
}
< prev index next >