public class RedisProtocol extends Object
Constructor and Description |
---|
RedisProtocol(BufferedInputStream is,
OutputStream os)
Create a new RedisProtocol using provided input and output streams.
|
RedisProtocol(Socket socket)
Create a new RedisProtocol from a socket connection.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the input and output streams.
|
static byte[] |
readBytes(InputStream is)
Read fixed size field from the stream.
|
static long |
readLong(InputStream is)
Read a signed ascii integer from the input stream.
|
static Reply |
receive(InputStream is)
Read a Reply from an input stream.
|
Reply |
receiveAsync()
Wait for a reply on the input stream.
|
void |
sendAsync(Command command)
Send a command over the wire, do not wait for a reponse.
|
static byte[] |
toBytes(Number length) |
public static final char CR
public static final char LF
public RedisProtocol(Socket socket) throws IOException
socket
- IOException
public RedisProtocol(BufferedInputStream is, OutputStream os)
is
- a buffered input stream is requiredos
- a buffered input stream is requiredIOException
public static byte[] readBytes(InputStream is) throws IOException
is
- IOException
public static long readLong(InputStream is) throws IOException
is
- IOException
public static Reply receive(InputStream is) throws IOException
is
- IOException
public static byte[] toBytes(Number length)
public Reply receiveAsync() throws IOException
IOException
public void sendAsync(Command command) throws IOException
command
- IOException
public void close() throws IOException
IOException
Copyright © 2015. All rights reserved.