Package org.nuxeo.ecm.core.io
Class DummyServletOutputStream
- java.lang.Object
-
- java.io.OutputStream
-
- javax.servlet.ServletOutputStream
-
- org.nuxeo.ecm.core.io.DummyServletOutputStream
-
- All Implemented Interfaces:
Closeable
,Flushable
,AutoCloseable
public class DummyServletOutputStream extends javax.servlet.ServletOutputStream
A dummyServletOutputStream
for tests.- Since:
- 2023.0
-
-
Field Summary
Fields Modifier and Type Field Description protected ThrowableConsumer<Integer,IOException>
writer
-
Constructor Summary
Constructors Constructor Description DummyServletOutputStream(OutputStream out)
DummyServletOutputStream(ThrowableConsumer<Integer,IOException> writer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isReady()
void
setWriteListener(javax.servlet.WriteListener writeListener)
void
write(int b)
-
Methods inherited from class javax.servlet.ServletOutputStream
print, print, print, print, print, print, print, println, println, println, println, println, println, println, println
-
Methods inherited from class java.io.OutputStream
close, flush, nullOutputStream, write, write
-
-
-
-
Field Detail
-
writer
protected final ThrowableConsumer<Integer,IOException> writer
-
-
Constructor Detail
-
DummyServletOutputStream
public DummyServletOutputStream(OutputStream out)
- Parameters:
out
- theoutputStream
used to delegate the writing
-
DummyServletOutputStream
public DummyServletOutputStream(ThrowableConsumer<Integer,IOException> writer)
- Parameters:
writer
- theconsumer
used to delegate the writing
-
-
Method Detail
-
isReady
public boolean isReady()
- Specified by:
isReady
in classjavax.servlet.ServletOutputStream
-
setWriteListener
public void setWriteListener(javax.servlet.WriteListener writeListener)
- Specified by:
setWriteListener
in classjavax.servlet.ServletOutputStream
-
write
public void write(int b) throws IOException
- Specified by:
write
in classOutputStream
- Throws:
IOException
-
-