Package redis.clients.jedis.util
Class RedisInputStream
- java.lang.Object
-
- java.io.InputStream
-
- java.io.FilterInputStream
-
- redis.clients.jedis.util.RedisInputStream
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
public class RedisInputStream extends FilterInputStream
This class assumes (to some degree) that we are reading a RESP stream. As such it assumes certain conventions regarding CRLF line termination. It also assumes that if the Protocol layer requires a byte that if that byte is not there it is a stream error.
-
-
Field Summary
Fields Modifier and Type Field Description protected byte[]
buf
protected int
count
protected int
limit
-
Fields inherited from class java.io.FilterInputStream
in
-
-
Constructor Summary
Constructors Constructor Description RedisInputStream(InputStream in)
RedisInputStream(InputStream in, int size)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
read(byte[] b, int off, int len)
byte
readByte()
int
readIntCrLf()
String
readLine()
byte[]
readLineBytes()
long
readLongCrLf()
-
Methods inherited from class java.io.FilterInputStream
available, close, mark, markSupported, read, read, reset, skip
-
Methods inherited from class java.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, transferTo
-
-
-
-
Constructor Detail
-
RedisInputStream
public RedisInputStream(InputStream in, int size)
-
RedisInputStream
public RedisInputStream(InputStream in)
-
-
Method Detail
-
readByte
public byte readByte() throws JedisConnectionException
- Throws:
JedisConnectionException
-
readLine
public String readLine()
-
readLineBytes
public byte[] readLineBytes()
-
readIntCrLf
public int readIntCrLf()
-
readLongCrLf
public long readLongCrLf()
-
read
public int read(byte[] b, int off, int len) throws JedisConnectionException
- Overrides:
read
in classFilterInputStream
- Throws:
JedisConnectionException
-
-