@Override public int read(byte[] b, int off, int len) throws IOException { if (len == 0) { return 0; } int c = read(); if (c == -1) { return -1; } b[off] = (byte) c; int i = 1; // Don't try to fill up the buffer if the reader is waiting. for (; (i < len) && reader.ready(); i++) { c = read(); if (c == -1) { return i; } b[off + i] = (byte) c; } return i; }
public int read(byte b[], int off, int len) throws IOException { int c = read(); if (c == -1) { return -1; } b[off] = (byte)c; int i = 1; // Don't try to fill up the buffer if the reader is waiting. for (; i < len && reader.ready(); i++) { c = read(); if (c == -1) { return i; } b[off + i] = (byte)c; } return i; }
public int read(byte b[], int off, int len) throws IOException { int c = read(); if (c == -1) { return -1; } b[off] = (byte)c; int i = 1; // Don't try to fill up the buffer if the reader is waiting. for (; i < len && reader.ready(); i++) { c = read(); if (c == -1) { return i; } b[off + i] = (byte)c; } return i; }
public int read(byte[] b, int off, int len) throws IOException { if (len == 0) { return 0; } int c = read(); if (c == -1) { return -1; } b[off] = (byte) c; int i = 1; // Don't try to fill up the buffer if the reader is waiting. for (; (i < len) && reader.ready(); i++) { c = read(); if (c == -1) { return i; } b[off + i] = (byte) c; } return i; }
@Override public int read(byte[] b, int off, int len) throws IOException { if (len == 0) { return 0; } int c = read(); if (c == -1) { return -1; } b[off] = (byte) c; int i = 1; // Don't try to fill up the buffer if the reader is waiting. for (; (i < len) && reader.ready(); i++) { c = read(); if (c == -1) { return i; } b[off + i] = (byte) c; } return i; }