@Override public void write(final int b) throws IOException { if (!closed) { write0(b); } else { throw new IOException("closed"); } }
@Override public void write(final byte[] buf, int offs, final int len) throws IOException { if (offs < 0) { throw new IndexOutOfBoundsException("offs(" + offs + ") < 0."); } if (len < 0) { throw new IndexOutOfBoundsException("len(" + len + ") < 0."); } if (offs + len > buf.length) { throw new IndexOutOfBoundsException("offs(" + offs + ") + len(" + len + ") > buf.length(" + buf.length + ")."); } if (closed) { throw new IOException("stream closed"); } for (final int hi = offs + len; offs < hi;) { write0(buf[offs++]); } }
@Override public void write(final int b) throws IOException { if (!closed) { write0(b); } else { throw new IOException("closed"); } }
@Override public void write(final byte[] buf, int offs, final int len) throws IOException { if (offs < 0) { throw new IndexOutOfBoundsException("offs(" + offs + ") < 0."); } if (len < 0) { throw new IndexOutOfBoundsException("len(" + len + ") < 0."); } if (offs + len > buf.length) { throw new IndexOutOfBoundsException("offs(" + offs + ") + len(" + len + ") > buf.length(" + buf.length + ")."); } if (closed) { throw new IOException("stream closed"); } for (final int hi = offs + len; offs < hi;) { write0(buf[offs++]); } }