java.lang.Object
java.io.InputStream
jakarta.servlet.ServletInputStream
cloud.piranha.core.api.WebApplicationInputStream
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Runnable
- Direct Known Subclasses:
DefaultWebApplicationInputStream
public abstract class WebApplicationInputStream
extends jakarta.servlet.ServletInputStream
implements Runnable
The web application input stream.
- Author:
- Manfred Riem ([email protected])
-
Field Summary
Modifier and TypeFieldDescriptionprotected boolean
Stores the finished flag.protected int
Stores the read index.protected InputStream
Stores the input stream.protected jakarta.servlet.ReadListener
Stores the read listener.protected Lock
Stores the read listener lock.protected WebApplicationRequest
Stores the web application request. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
jakarta.servlet.ReadListener
Get the read listener.boolean
boolean
isReady()
int
read()
void
run()
void
setInputStream
(InputStream inputStream) Set the input stream.void
setReadListener
(jakarta.servlet.ReadListener readListener) void
setWebApplicationRequest
(WebApplicationRequest webApplicationRequest) Set the web application request.Methods inherited from class jakarta.servlet.ServletInputStream
readLine
Methods inherited from class java.io.InputStream
available, mark, markSupported, nullInputStream, read, read, readAllBytes, readNBytes, readNBytes, reset, skip, skipNBytes, transferTo
-
Field Details
-
finished
protected boolean finishedStores the finished flag. -
index
protected int indexStores the read index. -
inputStream
Stores the input stream. -
readListener
protected jakarta.servlet.ReadListener readListenerStores the read listener. -
readListenerLock
Stores the read listener lock. -
webApplicationRequest
Stores the web application request.
-
-
Constructor Details
-
WebApplicationInputStream
public WebApplicationInputStream()Constructor.
-
-
Method Details
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classInputStream
- Throws:
IOException
-
getReadListener
public jakarta.servlet.ReadListener getReadListener()Get the read listener.- Returns:
- the read listener, or null if not set.
-
isFinished
public boolean isFinished()- Specified by:
isFinished
in classjakarta.servlet.ServletInputStream
-
isReady
public boolean isReady()- Specified by:
isReady
in classjakarta.servlet.ServletInputStream
-
read
- Specified by:
read
in classInputStream
- Throws:
IOException
-
run
public void run() -
setInputStream
Set the input stream.- Parameters:
inputStream
- the input stream.
-
setReadListener
public void setReadListener(jakarta.servlet.ReadListener readListener) - Specified by:
setReadListener
in classjakarta.servlet.ServletInputStream
-
setWebApplicationRequest
Set the web application request.- Parameters:
webApplicationRequest
- the web application request.
-