public int read(byte[] buf, int off, int len) throws IOException { if (closed) throw new IOException(); if (data instanceof UTF8Reader) { return ((UTF8Reader) data).readAsciiInto(buf, off, len); } if (len > conv.length) len = conv.length; len = data.read(conv, 0, len); if (len == -1) return -1; for (int i = 0; i < len; i++) { char c = conv[i]; byte cb; if (c <= 255) cb = (byte) c; else cb = (byte) '?'; // Question mark - out of range character. buf[off++] = cb; } return len; }
public int read(byte[] buf, int off, int len) throws IOException { if (closed) throw new IOException(); if (data instanceof UTF8Reader) { return ((UTF8Reader) data).readAsciiInto(buf, off, len); } if (len > conv.length) len = conv.length; len = data.read(conv, 0, len); if (len == -1) return -1; for (int i = 0; i < len; i++) { char c = conv[i]; byte cb; if (c <= 255) cb = (byte) c; else cb = (byte) '?'; // Question mark - out of range character. buf[off++] = cb; } return len; }
public int read(byte[] buf, int off, int len) throws IOException { if (closed) throw new IOException(); if (data instanceof UTF8Reader) { return ((UTF8Reader) data).readAsciiInto(buf, off, len); } if (len > conv.length) len = conv.length; len = data.read(conv, 0, len); if (len == -1) return -1; for (int i = 0; i < len; i++) { char c = conv[i]; byte cb; if (c <= 255) cb = (byte) c; else cb = (byte) '?'; // Question mark - out of range character. buf[off++] = cb; } return len; }