Class TcpBufferedInputStream
- java.lang.Object
-
- java.io.InputStream
-
- java.io.FilterInputStream
-
- org.apache.activemq.transport.tcp.TcpBufferedInputStream
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
public class TcpBufferedInputStream extends FilterInputStream
An optimized buffered input stream for Tcp
-
-
Field Summary
Fields Modifier and Type Field Description protected int
count
protected byte[]
internalBuffer
protected int
position
-
Fields inherited from class java.io.FilterInputStream
in
-
-
Constructor Summary
Constructors Constructor Description TcpBufferedInputStream(InputStream in)
TcpBufferedInputStream(InputStream in, int size)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
available()
void
close()
protected void
fill()
boolean
markSupported()
int
read()
int
read(byte[] b, int off, int len)
long
skip(long n)
void
unread(byte[] array)
-
Methods inherited from class java.io.FilterInputStream
mark, read, reset
-
Methods inherited from class java.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, transferTo
-
-
-
-
Constructor Detail
-
TcpBufferedInputStream
public TcpBufferedInputStream(InputStream in)
-
TcpBufferedInputStream
public TcpBufferedInputStream(InputStream in, int size)
-
-
Method Detail
-
fill
protected void fill() throws IOException
- Throws:
IOException
-
read
public int read() throws IOException
- Overrides:
read
in classFilterInputStream
- Throws:
IOException
-
read
public int read(byte[] b, int off, int len) throws IOException
- Overrides:
read
in classFilterInputStream
- Throws:
IOException
-
skip
public long skip(long n) throws IOException
- Overrides:
skip
in classFilterInputStream
- Throws:
IOException
-
available
public int available() throws IOException
- Overrides:
available
in classFilterInputStream
- Throws:
IOException
-
markSupported
public boolean markSupported()
- Overrides:
markSupported
in classFilterInputStream
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classFilterInputStream
- Throws:
IOException
-
unread
public void unread(byte[] array) throws IOException
- Parameters:
array
-- Throws:
IOException
-
-