/** * Writes the specified byte to this output stream. * * @param b * The byte to be written. * @exception IOException * if an error occurs. */ @Override public void write(final int b) throws IOException { checkThreshold(1); getStream().write(b); written++; }
/** * Checks to see if writing the specified number of bytes would cause the configured threshold * to be exceeded. If so, triggers an event to allow a concrete implementation to take action on * this. * * @param count * The number of bytes about to be written to the underlying output stream. * @exception IOException * if an error occurs. */ protected void checkThreshold(final int count) throws IOException { if (!thresholdExceeded && (written + count > threshold)) { thresholdReached(); thresholdExceeded = true; } }
/** * Flushes this output stream and forces any buffered output bytes to be written out. * * @exception IOException * if an error occurs. */ public void flush() throws IOException { getStream().flush(); }
/** * Flushes this output stream and forces any buffered output bytes to be written out. * * @exception IOException * if an error occurs. */ @Override public void flush() throws IOException { getStream().flush(); }
/** * Writes <code>b.length</code> bytes from the specified byte array to this output stream. * * @param b * The array of bytes to be written. * @exception IOException * if an error occurs. */ public void write(byte b[]) throws IOException { checkThreshold(b.length); getStream().write(b); written += b.length; }
/** * Flushes this output stream and forces any buffered output bytes to be written out. * * @exception IOException * if an error occurs. */ @Override public void flush() throws IOException { getStream().flush(); }
/** * Checks to see if writing the specified number of bytes would cause the configured threshold * to be exceeded. If so, triggers an event to allow a concrete implementation to take action on * this. * * @param count * The number of bytes about to be written to the underlying output stream. * @exception IOException * if an error occurs. */ protected void checkThreshold(int count) throws IOException { if (!thresholdExceeded && (written + count > threshold)) { thresholdReached(); thresholdExceeded = true; } }
/** * Writes the specified byte to this output stream. * * @param b * The byte to be written. * @exception IOException * if an error occurs. */ public void write(int b) throws IOException { checkThreshold(1); getStream().write(b); written++; }
/** * Checks to see if writing the specified number of bytes would cause the configured threshold * to be exceeded. If so, triggers an event to allow a concrete implementation to take action on * this. * * @param count * The number of bytes about to be written to the underlying output stream. * @exception IOException * if an error occurs. */ protected void checkThreshold(int count) throws IOException { if (!thresholdExceeded && (written + count > threshold)) { thresholdReached(); thresholdExceeded = true; } }
/** * Writes <code>b.length</code> bytes from the specified byte array to this output stream. * * @param b * The array of bytes to be written. * @exception IOException * if an error occurs. */ @Override public void write(final byte b[]) throws IOException { checkThreshold(b.length); getStream().write(b); written += b.length; }
/** * Writes the specified byte to this output stream. * * @param b * The byte to be written. * @exception IOException * if an error occurs. */ @Override public void write(int b) throws IOException { checkThreshold(1); getStream().write(b); written++; }
/** * Writes <code>b.length</code> bytes from the specified byte array to this output stream. * * @param b * The array of bytes to be written. * @exception IOException * if an error occurs. */ @Override public void write(byte b[]) throws IOException { checkThreshold(b.length); getStream().write(b); written += b.length; }
/** * Writes <code>len</code> bytes from the specified byte array starting at offset * <code>off</code> to this output stream. * * @param b * The byte array from which the data will be written. * @param off * The start offset in the byte array. * @param len * The number of bytes to write. * @exception IOException * if an error occurs. */ @Override public void write(byte b[], int off, int len) throws IOException { checkThreshold(len); getStream().write(b, off, len); written += len; }
/** * Writes <code>len</code> bytes from the specified byte array starting at offset * <code>off</code> to this output stream. * * @param b * The byte array from which the data will be written. * @param off * The start offset in the byte array. * @param len * The number of bytes to write. * @exception IOException * if an error occurs. */ public void write(byte b[], int off, int len) throws IOException { checkThreshold(len); getStream().write(b, off, len); written += len; }
/** * Writes <code>len</code> bytes from the specified byte array starting at offset * <code>off</code> to this output stream. * * @param b * The byte array from which the data will be written. * @param off * The start offset in the byte array. * @param len * The number of bytes to write. * @exception IOException * if an error occurs. */ @Override public void write(final byte b[], final int off, final int len) throws IOException { checkThreshold(len); getStream().write(b, off, len); written += len; }