@Override public int read() throws IOException { byte[] b = { 0 }; // FIXME: compare against -1 or 1? (bug 59893) return (read(b) == 1) ? -1 : b[0]; }
@Override public int read(byte[] b, int off, int len) throws IOException { return read(b, off, len, false); }
/** * Used when BIFF header fields (sid, size) are being read. The internal * {@link Cipher} instance must step even when unencrypted bytes are read * */ @Override public void readPlain(byte b[], int off, int len) { if (len <= 0) { return; } try { int readBytes, total = 0; do { readBytes = read(b, off, len, true); total += Math.max(0, readBytes); } while (readBytes > -1 && total < len); if (total < len) { throw new EOFException("buffer underrun"); } } catch (IOException e) { // need to wrap checked exception, because of LittleEndianInput interface :( throw new RuntimeException(e); } }
@Override public int read() throws IOException { byte[] b = { 0 }; // FIXME: compare against -1 or 1? (bug 59893) return (read(b) == 1) ? -1 : b[0]; }
@Override public int read(byte[] b, int off, int len) throws IOException { return read(b, off, len, false); }
/** * Used when BIFF header fields (sid, size) are being read. The internal * {@link Cipher} instance must step even when unencrypted bytes are read * */ @Override public void readPlain(byte b[], int off, int len) { if (len <= 0) { return; } try { int readBytes, total = 0; do { readBytes = read(b, off, len, true); total += Math.max(0, readBytes); } while (readBytes > -1 && total < len); if (total < len) { throw new EOFException("buffer underrun"); } } catch (IOException e) { // need to wrap checked exception, because of LittleEndianInput interface :( throw new RuntimeException(e); } }