< prev index next >
src/java.base/share/classes/java/net/SocketInputStream.java
Print this page
@@ -45,11 +45,11 @@
init();
}
private boolean eof;
private AbstractPlainSocketImpl impl = null;
- private byte temp[];
+ private byte[] temp;
private Socket socket = null;
/**
* Creates a new SocketInputStream. Can only be called
* by a Socket. This method needs to hang on to the owner Socket so
@@ -89,11 +89,11 @@
* @return the actual number of bytes read, -1 is
* returned when the end of the stream is reached.
* @exception IOException If an I/O error has occurred.
*/
private native int socketRead0(FileDescriptor fd,
- byte b[], int off, int len,
+ byte[] b, int off, int len,
int timeout)
throws IOException;
// wrap native call to allow instrumentation
/**
@@ -107,11 +107,11 @@
* @return the actual number of bytes read, -1 is
* returned when the end of the stream is reached.
* @exception IOException If an I/O error has occurred.
*/
private int socketRead(FileDescriptor fd,
- byte b[], int off, int len,
+ byte[] b, int off, int len,
int timeout)
throws IOException {
return socketRead0(fd, b, off, len, timeout);
}
@@ -120,11 +120,11 @@
* @param b the buffer into which the data is read
* @return the actual number of bytes read, -1 is
* returned when the end of the stream is reached.
* @exception IOException If an I/O error has occurred.
*/
- public int read(byte b[]) throws IOException {
+ public int read(byte[] b) throws IOException {
return read(b, 0, b.length);
}
/**
* Reads into a byte array <i>b</i> at offset <i>off</i>,
@@ -134,15 +134,15 @@
* @param length the maximum number of bytes read
* @return the actual number of bytes read, -1 is
* returned when the end of the stream is reached.
* @exception IOException If an I/O error has occurred.
*/
- public int read(byte b[], int off, int length) throws IOException {
+ public int read(byte[] b, int off, int length) throws IOException {
return read(b, off, length, impl.getTimeout());
}
- int read(byte b[], int off, int length, int timeout) throws IOException {
+ int read(byte[] b, int off, int length, int timeout) throws IOException {
int n;
// EOF already encountered
if (eof) {
return -1;
@@ -214,11 +214,11 @@
if (numbytes <= 0) {
return 0;
}
long n = numbytes;
int buflen = (int) Math.min(1024, n);
- byte data[] = new byte[buflen];
+ byte[] data = new byte[buflen];
while (n > 0) {
int r = read(data, 0, (int) Math.min((long) buflen, n));
if (r < 0) {
break;
}
< prev index next >