/** * 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)) { thresholdExceeded = true; thresholdReached(); } }
/** * Closes underlying output stream, and mark this as closed * * @exception IOException if an error occurs. */ @Override public void close() throws IOException { super.close(); } }
/** * 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(); }
/** * Flushes this output stream and forces any buffered output bytes to be * written out. * * @throws IOException if an error occurs. */ @Override public void flush() throws IOException { getStream().flush(); }
/** * 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++; }
/** * 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) { thresholdExceeded = true; thresholdReached(); } }
/** * Closes underlying output stream, and mark this as closed * * @exception IOException if an error occurs. */ @Override public void close() throws IOException { super.close(); closed = true; }
/** * 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++; }
/** * 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)) { thresholdExceeded = true; thresholdReached(); } }
/** * Closes underlying output stream, and mark this as closed * * @exception IOException if an error occurs. */ @Override public void close() throws IOException { super.close(); closed = 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. */ 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(); }