Package org.apache.catalina.connector
Class CoyoteInputStream
- java.lang.Object
-
- java.io.InputStream
-
- jakarta.servlet.ServletInputStream
-
- org.apache.catalina.connector.CoyoteInputStream
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
public class CoyoteInputStream extends jakarta.servlet.ServletInputStream
This class handles reading bytes.- Author:
- Remy Maucherat, Jean-Francois Arcand
-
-
Field Summary
Fields Modifier and Type Field Description protected InputBuffer
ib
-
Constructor Summary
Constructors Constructor Description CoyoteInputStream(InputBuffer ib)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
available()
protected Object
clone()
Prevent cloning the facade.void
close()
Close the stream Since we re-cycle, we can't allow the call to super.close() which would permanently disable us.boolean
isFinished()
boolean
isReady()
int
read()
int
read(byte[] b)
int
read(byte[] b, int off, int len)
int
readLine(byte[] b, int off, int len)
void
setReadListener(jakarta.servlet.ReadListener readListener)
-
Methods inherited from class java.io.InputStream
mark, markSupported, nullInputStream, readAllBytes, readNBytes, readNBytes, reset, skip, transferTo
-
-
-
-
Field Detail
-
ib
protected InputBuffer ib
-
-
Constructor Detail
-
CoyoteInputStream
public CoyoteInputStream(InputBuffer ib)
-
-
Method Detail
-
clone
protected Object clone() throws CloneNotSupportedException
Prevent cloning the facade.- Overrides:
clone
in classObject
- Throws:
CloneNotSupportedException
-
read
public int read() throws IOException
- Specified by:
read
in classInputStream
- Throws:
IOException
-
available
public int available() throws IOException
- Overrides:
available
in classInputStream
- Throws:
IOException
-
read
public int read(byte[] b) throws IOException
- Overrides:
read
in classInputStream
- Throws:
IOException
-
read
public int read(byte[] b, int off, int len) throws IOException
- Overrides:
read
in classInputStream
- Throws:
IOException
-
readLine
public int readLine(byte[] b, int off, int len) throws IOException
- Overrides:
readLine
in classjakarta.servlet.ServletInputStream
- Throws:
IOException
-
isFinished
public boolean isFinished()
- Specified by:
isFinished
in classjakarta.servlet.ServletInputStream
-
isReady
public boolean isReady()
- Specified by:
isReady
in classjakarta.servlet.ServletInputStream
-
setReadListener
public void setReadListener(jakarta.servlet.ReadListener readListener)
- Specified by:
setReadListener
in classjakarta.servlet.ServletInputStream
-
close
public void close() throws IOException
Close the stream Since we re-cycle, we can't allow the call to super.close() which would permanently disable us.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classInputStream
- Throws:
IOException
-
-