@Override public Reader getCharacterStream () { return new NonBlockingStringReader (m_sText); }
public void close () { StreamHelper.close (m_aHttpClient); m_aHttpClient = null; }
private String _getLine (final NonBlockingBufferedReader in) throws IOException { final String line = m_currentLine; m_currentLine = null; if (line == null) in.readLine (); return line; }
@Nonnull private static NonBlockingByteArrayInputStream _getCachedInputStream (@Nonnull @WillClose final InputStream aIS) { return new NonBlockingByteArrayInputStream (StreamHelper.getAllBytes (aIS)); }
LoggingServletInputStream (final byte [] content) { m_aIS = new NonBlockingByteArrayInputStream (content); }
@Nonnull public InputStream getNonUpwardClosingInputStream () throws IOException { // Use "NonClosing" internally to that the returned stream is easily // discovered as "buffered" return StreamHelper.getBuffered (new NonClosingInputStream (m_aSocket.getInputStream ())); } }
@Nonnull public String getAsString () { return m_aSW.getAsString (); }
public static void copyStream (@WillNotClose final InputStream aIS, @WillNotClose final OutputStream aOS) { StreamHelper.copyInputStreamToOutputStream (new NonClosingInputStream (aIS), aOS); } }
public byte [] getContentAsBytes () { return m_aOS.m_aBAOS.toByteArray (); }
@Override public void write (final int b) throws IOException { m_aBAOS.write (b); }
@Override public void finishedPayload () { StreamHelper.flush (m_aOS); }
@Override public String toString () { return ToStringGenerator.getDerived (super.toString ()).append ("Mac", m_aMac).append ("On", m_bOn).getToString (); } }
@Override public final void close () throws IOException { StreamHelper.close (m_aZipInputStream); m_aZipInputStream = null; }
@Override public void write (final byte [] b) throws IOException { m_aBAOS.write (b); }
private String _peekLine (final NonBlockingBufferedReader in) throws IOException { if (m_currentLine == null) m_currentLine = in.readLine (); return m_currentLine; }
@Override public void close () { StreamHelper.close (m_aOS); }
@Override public void write (final byte [] b, final int off, final int len) throws IOException { m_aBAOS.write (b, off, len); } }
public void close () { StreamHelper.close (m_aHttpClientMgr); }
public void close () throws XMLStreamException { debug ( () -> "close ()"); StreamHelper.close (m_aEmitter); }
void closeAll () { StreamHelper.close (m_out); PGPrinter.flush (); }