Qizx/open API

net.axyana.qizxopen.util
Class ByteOutputBase

java.lang.Object
  extended bynet.axyana.qizxopen.util.ByteOutputBase
All Implemented Interfaces:
ByteOutput, java.io.Serializable
Direct Known Subclasses:
ByteOutputStream, CoreByteOutput

public abstract class ByteOutputBase
extends java.lang.Object
implements ByteOutput, java.io.Serializable

Abstract BufferedOutputStream with support for more data types.

See Also:
Serialized Form

Method Summary
static int encodeInt(int code, byte[] buffer, int bufSize)
          Stores a positive int in variable-length encoding.
static int encodeLong(long code, byte[] buffer, int bufSize)
           
 void flush()
           
 void flushMark()
           
 void putByte(byte b)
           
 void putByte(int b)
           
 void putBytes(byte[] buf)
           
 void putBytes(byte[] buf, int start, int bsize)
           
 void putChars(char[] chars)
           
 void putChars(char[] chars, int start, int length)
           
 void putDouble(double value)
           
 void putString(java.lang.String s)
           
 void putVint(int code)
           
 void putVlong(long code)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

flush

public void flush()
           throws java.io.IOException
Throws:
java.io.IOException

flushMark

public void flushMark()
               throws java.io.IOException
Specified by:
flushMark in interface ByteOutput
Throws:
java.io.IOException

putByte

public void putByte(int b)
             throws java.io.IOException
Specified by:
putByte in interface ByteOutput
Throws:
java.io.IOException

putByte

public void putByte(byte b)
             throws java.io.IOException
Throws:
java.io.IOException

putBytes

public void putBytes(byte[] buf)
              throws java.io.IOException
Specified by:
putBytes in interface ByteOutput
Throws:
java.io.IOException

putBytes

public void putBytes(byte[] buf,
                     int start,
                     int bsize)
              throws java.io.IOException
Throws:
java.io.IOException

putVint

public void putVint(int code)
             throws java.io.IOException
Specified by:
putVint in interface ByteOutput
Throws:
java.io.IOException

putVlong

public void putVlong(long code)
              throws java.io.IOException
Specified by:
putVlong in interface ByteOutput
Throws:
java.io.IOException

putDouble

public void putDouble(double value)
               throws java.io.IOException
Specified by:
putDouble in interface ByteOutput
Throws:
java.io.IOException

putString

public void putString(java.lang.String s)
               throws java.io.IOException
Specified by:
putString in interface ByteOutput
Throws:
java.io.IOException

putChars

public void putChars(char[] chars,
                     int start,
                     int length)
              throws java.io.IOException
Specified by:
putChars in interface ByteOutput
Throws:
java.io.IOException

putChars

public void putChars(char[] chars)
              throws java.io.IOException
Throws:
java.io.IOException

encodeInt

public static int encodeInt(int code,
                            byte[] buffer,
                            int bufSize)
Stores a positive int in variable-length encoding. Assumes that the buffer is large enough.

Returns:
the new buffer size.

encodeLong

public static int encodeLong(long code,
                             byte[] buffer,
                             int bufSize)

© 2005 Axyana Software