/** * Closes underlying output stream, and mark this as closed * * @throws IOException if an error occurs. */ @Override public void close() throws IOException { super.close(); closed = true; }
/** * Closes underlying output stream, and mark this as closed * * @exception IOException if an error occurs. */ public void close() throws IOException { super.close(); closed = true; }
@Test public void testSetByteCount() throws Exception { final AtomicBoolean reached = new AtomicBoolean(false); final ThresholdingOutputStream tos = new ThresholdingOutputStream(3) { { setByteCount(2); } @Override protected OutputStream getStream() throws IOException { return new ByteArrayOutputStream(4); } @Override protected void thresholdReached() throws IOException { reached.set( true); } }; tos.write(12); assertFalse( reached.get()); tos.write(12); assertTrue(reached.get()); tos.close(); } }
/** * Closes underlying output stream, and mark this as closed * * @exception java.io.IOException if an error occurs. */ @Override public void close() throws IOException { super.close(); closed = true; currentOutputStream.close(); }
/** * Closes underlying output stream, and mark this as closed * * @throws IOException if an error occurs. */ public void close() throws IOException { super.close(); closed = true; }
/** * 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; }
/** * Closes underlying output stream, and mark this as closed * * @throws IOException if an error occurs. */ public void close() throws IOException { super.close(); closed = true; }
/** * Closes underlying output stream, and mark this as closed * * @throws IOException if an error occurs. */ @Override public void close() throws IOException { super.close(); closed = true; }
/** * Closes underlying output stream, and mark this as closed * * @exception IOException if an error occurs. */ public void close() throws IOException { super.close(); closed = true; }
/** * Closes underlying output stream, and mark this as closed * * @throws IOException if an error occurs. */ public void close() throws IOException { super.close(); closed = true; }
/** * 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; }
/** * Closes underlying output stream, and mark this as closed * * @exception IOException if an error occurs. */ public void close() throws IOException { super.close(); closed = true; }
/** * 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; }
/** * 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; }
@Override public void close() throws IOException { if(buffer != null) { // we have finished writing data without hitting the threshold, so // send it uncompressed currentStream = connection.getOutputStream(); currentStream.write(buffer.toByteArray()); } super.close(); }
cachedResponse.getThresholdingOutputStream().close();
cachedResponse.getThresholdingOutputStream().close();