public int read(byte[] buf, int off, int len) throws IOException { int i, c; for (i = 0; i < len; i++) { if ((c = read()) == -1) { if (i == 0) // At end of stream, so we should i = -1; // return -1, NOT 0. break; } buf[off+i] = (byte)c; } return i; }
@Override public int read(byte[] buf, int off, int len) throws IOException { int i, c; for (i = 0; i < len; i++) { if ((c = read()) == -1) { if (i == 0) // At end of stream, so we should i = -1; // return -1, NOT 0. break; } buf[off+i] = (byte)c; } return i; }
public int read(byte[] buf, int off, int len) throws IOException { int i, c; for (i = 0; i < len; i++) { if ((c = read()) == -1) { if (i == 0) // At end of stream, so we should i = -1; // return -1, NOT 0. break; } buf[off+i] = (byte)c; } return i; }
public int read(byte[] buf, int off, int len) throws IOException { int i, c; for (i = 0; i < len; i++) { if ((c = read()) == -1) { if (i == 0) // At end of stream, so we should i = -1; // return -1, NOT 0. break; } buf[off+i] = (byte)c; } return i; }
@Override public int read(byte[] buf, int off, int len) throws IOException { int i, c; for (i = 0; i < len; i++) { if ((c = read()) == -1) { if (i == 0) // At end of stream, so we should i = -1; // return -1, NOT 0. break; } buf[off+i] = (byte)c; } return i; }
@Override public int read(byte[] buf, int off, int len) throws IOException { int i, c; for (i = 0; i < len; i++) { if ((c = read()) == -1) { if (i == 0) // At end of stream, so we should i = -1; // return -1, NOT 0. break; } buf[off+i] = (byte)c; } return i; }
@Override public int read(byte[] buf, int off, int len) throws IOException { int i, c; for (i = 0; i < len; i++) { if ((c = read()) == -1) { if (i == 0) // At end of stream, so we should i = -1; // return -1, NOT 0. break; } buf[off+i] = (byte)c; } return i; }
@Override public int read(byte[] buf, int off, int len) throws IOException { int i, c; for (i = 0; i < len; i++) { if ((c = read()) == -1) { if (i == 0) // At end of stream, so we should i = -1; // return -1, NOT 0. break; } buf[off+i] = (byte)c; } return i; }
@Override public int read(byte[] buf, int off, int len) throws IOException { int i, c; for (i = 0; i < len; i++) { if ((c = read()) == -1) { if (i == 0) // At end of stream, so we should i = -1; // return -1, NOT 0. break; } buf[off+i] = (byte)c; } return i; }