redis.clients.util
Class RedisOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by java.io.FilterOutputStream
          extended by redis.clients.util.RedisOutputStream
All Implemented Interfaces:
Closeable, Flushable

public final class RedisOutputStream
extends FilterOutputStream

The class implements a buffered output stream without synchronization There are also special operations like in-place string encoding. This stream fully ignore mark/reset and should not be used outside Jedis


Field Summary
protected  byte[] buf
           
protected  int count
           
 
Fields inherited from class java.io.FilterOutputStream
out
 
Constructor Summary
RedisOutputStream(OutputStream out)
           
RedisOutputStream(OutputStream out, int size)
           
 
Method Summary
 void flush()
           
static boolean isSurrogate(char ch)
           
static int utf8Length(String str)
           
 void write(byte b)
           
 void write(byte[] b)
           
 void write(byte[] b, int off, int len)
           
 void writeAsciiCrLf(String in)
           
 void writeCrLf()
           
 void writeIntCrLf(int value)
           
 void writeUtf8CrLf(String str)
           
 
Methods inherited from class java.io.FilterOutputStream
close, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

buf

protected final byte[] buf

count

protected int count
Constructor Detail

RedisOutputStream

public RedisOutputStream(OutputStream out)

RedisOutputStream

public RedisOutputStream(OutputStream out,
                         int size)
Method Detail

write

public void write(byte b)
           throws IOException
Throws:
IOException

write

public void write(byte[] b)
           throws IOException
Overrides:
write in class FilterOutputStream
Throws:
IOException

write

public void write(byte[] b,
                  int off,
                  int len)
           throws IOException
Overrides:
write in class FilterOutputStream
Throws:
IOException

writeAsciiCrLf

public void writeAsciiCrLf(String in)
                    throws IOException
Throws:
IOException

isSurrogate

public static boolean isSurrogate(char ch)

utf8Length

public static int utf8Length(String str)

writeCrLf

public void writeCrLf()
               throws IOException
Throws:
IOException

writeUtf8CrLf

public void writeUtf8CrLf(String str)
                   throws IOException
Throws:
IOException

writeIntCrLf

public void writeIntCrLf(int value)
                  throws IOException
Throws:
IOException

flush

public void flush()
           throws IOException
Specified by:
flush in interface Flushable
Overrides:
flush in class FilterOutputStream
Throws:
IOException


Copyright © 2012. All Rights Reserved.