Package org.eclipse.jetty.server
Class HttpOutput
java.lang.Object
java.io.OutputStream
javax.servlet.ServletOutputStream
org.eclipse.jetty.server.HttpOutput
- All Implemented Interfaces:
Closeable
,Flushable
,AutoCloseable
,Runnable
@Deprecated(since="2021-05-27")
public class HttpOutput
extends ServletOutputStream
implements Runnable
Deprecated.
The Eclipse Jetty and Apache Felix Http Jetty packages are no longer supported.
HttpOutput
implements ServletOutputStream
as required by the Servlet specification.
HttpOutput
buffers content written by the application until a
further write will overflow the buffer, at which point it triggers a commit
of the response.
HttpOutput
can be closed and reopened, to allow requests included
via RequestDispatcher.include(ServletRequest, ServletResponse)
to
close the stream, to be reopened after the inclusion ends.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
Deprecated.The Eclipse Jetty and Apache Felix Http Jetty packages are no longer supported. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Deprecated.void
Deprecated.void
Deprecated.Called to indicate that the request cycle has been completed.void
flush()
Deprecated.Deprecated.int
Deprecated.Deprecated.Deprecated.long
Deprecated.boolean
isAsync()
Deprecated.boolean
isClosed()
Deprecated.boolean
isReady()
Deprecated.Checks if a non-blocking write will succeed.boolean
Deprecated.void
onFlushed
(long bytes) Deprecated.Invoked when bytes have been flushed to the network.void
Deprecated.Writes aString
to the client, without a carriage return-line feed (CRLF) character at the end.void
println
(boolean b) Deprecated.Writes aboolean
value to the client, followed by a carriage return-line feed (CRLF).void
println
(char c) Deprecated.Writes a character to the client, followed by a carriage return-line feed (CRLF).void
println
(double d) Deprecated.Writes adouble
value to the client, followed by a carriage return-line feed (CRLF).void
println
(float f) Deprecated.Writes afloat
value to the client, followed by a carriage return-line feed (CRLF).void
println
(int i) Deprecated.Writes an int to the client, followed by a carriage return-line feed (CRLF) character.void
println
(long l) Deprecated.Writes along
value to the client, followed by a carriage return-line feed (CRLF).void
Deprecated.Writes aString
to the client, followed by a carriage return-line feed (CRLF).void
recycle()
Deprecated.void
reopen()
Deprecated.void
Deprecated.void
run()
Deprecated.void
Deprecated.Blocking send of stream content.void
sendContent
(InputStream in, Callback callback) Deprecated.Asynchronous send of stream content.void
sendContent
(ByteBuffer content) Deprecated.Blocking send of whole content.void
sendContent
(ByteBuffer content, Callback callback) Deprecated.Asynchronous send of whole content.void
Deprecated.Blocking send of channel content.void
sendContent
(ReadableByteChannel in, Callback callback) Deprecated.Asynchronous send of channel content.void
sendContent
(HttpContent content) Deprecated.Blocking send of HTTP content.void
sendContent
(HttpContent httpContent, Callback callback) Deprecated.Asynchronous send of HTTP content.void
setBufferSize
(int size) Deprecated.void
setInterceptor
(HttpOutput.Interceptor interceptor) Deprecated.void
setWriteListener
(WriteListener writeListener) Deprecated.Sets theWriteListener
for thisServletOutputStream
and thereby switches to non-blocking IO.void
Deprecated.toString()
Deprecated.void
write
(byte[] b, int off, int len) Deprecated.void
write
(int b) Deprecated.void
write
(ByteBuffer buffer) Deprecated.Methods inherited from class javax.servlet.ServletOutputStream
print, print, print, print, print, print, println
Methods inherited from class java.io.OutputStream
nullOutputStream, write
-
Constructor Details
-
HttpOutput
Deprecated.
-
-
Method Details
-
getHttpChannel
Deprecated. -
getInterceptor
Deprecated. -
setInterceptor
Deprecated. -
isWritten
public boolean isWritten()Deprecated. -
getWritten
public long getWritten()Deprecated. -
reopen
public void reopen()Deprecated. -
softClose
public void softClose()Deprecated. -
complete
Deprecated. -
completed
Deprecated.Called to indicate that the request cycle has been completed. -
close
Deprecated.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classOutputStream
- Throws:
IOException
-
getBuffer
Deprecated. -
isClosed
public boolean isClosed()Deprecated. -
isAsync
public boolean isAsync()Deprecated. -
flush
Deprecated.- Specified by:
flush
in interfaceFlushable
- Overrides:
flush
in classOutputStream
- Throws:
IOException
-
write
Deprecated.- Overrides:
write
in classOutputStream
- Throws:
IOException
-
write
Deprecated.- Throws:
IOException
-
write
Deprecated.- Specified by:
write
in classOutputStream
- Throws:
IOException
-
print
Deprecated.Description copied from class:ServletOutputStream
Writes aString
to the client, without a carriage return-line feed (CRLF) character at the end.- Overrides:
print
in classServletOutputStream
- Parameters:
s
- theString
to send to the client- Throws:
IOException
- if an input or output exception occurred
-
println
Deprecated.Description copied from class:ServletOutputStream
Writes aString
to the client, followed by a carriage return-line feed (CRLF).- Overrides:
println
in classServletOutputStream
- Parameters:
s
- theString
to write to the client- Throws:
IOException
- if an input or output exception occurred
-
println
Deprecated.Description copied from class:ServletOutputStream
Writes aboolean
value to the client, followed by a carriage return-line feed (CRLF).- Overrides:
println
in classServletOutputStream
- Parameters:
b
- theboolean
value to write to the client- Throws:
IOException
- if an input or output exception occurred
-
println
Deprecated.Description copied from class:ServletOutputStream
Writes a character to the client, followed by a carriage return-line feed (CRLF).- Overrides:
println
in classServletOutputStream
- Parameters:
c
- the character to write to the client- Throws:
IOException
- if an input or output exception occurred
-
println
Deprecated.Description copied from class:ServletOutputStream
Writes an int to the client, followed by a carriage return-line feed (CRLF) character.- Overrides:
println
in classServletOutputStream
- Parameters:
i
- the int to write to the client- Throws:
IOException
- if an input or output exception occurred
-
println
Deprecated.Description copied from class:ServletOutputStream
Writes along
value to the client, followed by a carriage return-line feed (CRLF).- Overrides:
println
in classServletOutputStream
- Parameters:
l
- thelong
value to write to the client- Throws:
IOException
- if an input or output exception occurred
-
println
Deprecated.Description copied from class:ServletOutputStream
Writes afloat
value to the client, followed by a carriage return-line feed (CRLF).- Overrides:
println
in classServletOutputStream
- Parameters:
f
- thefloat
value to write to the client- Throws:
IOException
- if an input or output exception occurred
-
println
Deprecated.Description copied from class:ServletOutputStream
Writes adouble
value to the client, followed by a carriage return-line feed (CRLF).- Overrides:
println
in classServletOutputStream
- Parameters:
d
- thedouble
value to write to the client- Throws:
IOException
- if an input or output exception occurred
-
sendContent
Deprecated.Blocking send of whole content.- Parameters:
content
- The whole content to send- Throws:
IOException
- if the send fails
-
sendContent
Deprecated.Blocking send of stream content.- Parameters:
in
- The stream content to send- Throws:
IOException
- if the send fails
-
sendContent
Deprecated.Blocking send of channel content.- Parameters:
in
- The channel content to send- Throws:
IOException
- if the send fails
-
sendContent
Deprecated.Blocking send of HTTP content.- Parameters:
content
- The HTTP content to send- Throws:
IOException
- if the send fails
-
sendContent
Deprecated.Asynchronous send of whole content.- Parameters:
content
- The whole content to sendcallback
- The callback to use to notify success or failure
-
sendContent
Deprecated.Asynchronous send of stream content. The stream will be closed after reading all content.- Parameters:
in
- The stream content to sendcallback
- The callback to use to notify success or failure
-
sendContent
Deprecated.Asynchronous send of channel content. The channel will be closed after reading all content.- Parameters:
in
- The channel content to sendcallback
- The callback to use to notify success or failure
-
sendContent
Deprecated.Asynchronous send of HTTP content.- Parameters:
httpContent
- The HTTP content to sendcallback
- The callback to use to notify success or failure
-
getBufferSize
public int getBufferSize()Deprecated. -
setBufferSize
public void setBufferSize(int size) Deprecated. -
onFlushed
Deprecated.Invoked when bytes have been flushed to the network.
The number of flushed bytes may be different from the bytes written by the application if an
HttpOutput.Interceptor
changed them, for example by compressing them.- Parameters:
bytes
- the number of bytes flushed- Throws:
IOException
- if the minimum data rate, when set, is not respected- See Also:
-
recycle
public void recycle()Deprecated. -
resetBuffer
public void resetBuffer()Deprecated. -
setWriteListener
Deprecated.Description copied from class:ServletOutputStream
Sets theWriteListener
for thisServletOutputStream
and thereby switches to non-blocking IO. It is only valid to switch to non-blocking IO within async processing or HTTP upgrade processing.- Specified by:
setWriteListener
in classServletOutputStream
- Parameters:
writeListener
- The non-blocking IO write listener
-
isReady
public boolean isReady()Deprecated.Description copied from class:ServletOutputStream
Checks if a non-blocking write will succeed. If this returnsfalse
, it will cause a callback toWriteListener.onWritePossible()
when the buffer has emptied. If this method returnsfalse
no further data must be written until the contain callsWriteListener.onWritePossible()
.- Specified by:
isReady
in classServletOutputStream
- Returns:
true
if data can be written, elsefalse
-
run
public void run()Deprecated. -
toString
Deprecated.
-