net.xfra.qizxopen.util
Class OutputByteStream
java.lang.Object
|
+--net.xfra.qizxopen.util.OutputByteStream
- public class OutputByteStream
- extends java.lang.Object
An efficient BufferedOutputStream with support for more data types.
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
OutputByteStream
public OutputByteStream(java.io.File file)
throws java.io.FileNotFoundException
OutputByteStream
public OutputByteStream(java.io.OutputStream out)
putByte
public void putByte(int b)
throws java.io.IOException
java.io.IOException
putBytes
public void putBytes(byte[] buf)
throws java.io.IOException
java.io.IOException
putBytes
public void putBytes(byte[] buf,
int start,
int bsize)
throws java.io.IOException
java.io.IOException
flush
public void flush()
throws java.io.IOException
java.io.IOException
close
public void close()
throws java.io.IOException
java.io.IOException
syncClose
public void syncClose()
throws java.io.IOException
- Closes and synchronizes the file on disk.
CAUTION: assumes the underlying OutputStream is a FileOutputStream.
java.io.IOException
putVint
public void putVint(int code)
throws java.io.IOException
java.io.IOException
putVlong
public void putVlong(long code)
throws java.io.IOException
java.io.IOException
putDouble
public void putDouble(double value)
throws java.io.IOException
java.io.IOException
putString
public void putString(java.lang.String s)
throws java.io.IOException
java.io.IOException
putChars
public void putChars(char[] chars)
throws java.io.IOException
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)