org.exist.storage.io
Class VariableByteOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by org.exist.storage.io.VariableByteOutputStream
All Implemented Interfaces:
Closeable, Flushable

public class VariableByteOutputStream
extends OutputStream

A byte array output stream using variable byte encoding.

Author:
wolf

Constructor Summary
VariableByteOutputStream()
           
VariableByteOutputStream(int size)
           
 
Method Summary
 void clear()
           
 void close()
           
 ByteArray data()
           
 void flush()
           
 int position()
           
 int size()
           
 byte[] toByteArray()
           
 void write(byte[] b)
           
 void write(byte[] b, int off, int len)
           
 void write(ByteArray b)
           
 void write(int b)
           
 void writeByte(byte b)
           
 void writeFixedInt(int i)
           
 void writeFixedInt(int position, int i)
           
 void writeFixedLong(long l)
           
 void writeInt(int i)
           
 void writeInt(int position, int i)
           
 void writeLong(long l)
           
 void writeShort(int s)
           
 void writeUTF(String s)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VariableByteOutputStream

public VariableByteOutputStream()

VariableByteOutputStream

public VariableByteOutputStream(int size)
Method Detail

clear

public void clear()

close

public void close()
           throws IOException
Specified by:
close in interface Closeable
Overrides:
close in class OutputStream
Throws:
IOException

size

public int size()

flush

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

position

public int position()

toByteArray

public byte[] toByteArray()

data

public ByteArray data()

write

public void write(int b)
           throws IOException
Specified by:
write in class OutputStream
Throws:
IOException

write

public void write(byte[] b)
Overrides:
write in class OutputStream

write

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

write

public void write(ByteArray b)

writeByte

public void writeByte(byte b)

writeShort

public void writeShort(int s)

writeInt

public void writeInt(int i)

writeFixedInt

public void writeFixedInt(int i)

writeFixedInt

public void writeFixedInt(int position,
                          int i)

writeInt

public void writeInt(int position,
                     int i)

writeLong

public void writeLong(long l)

writeFixedLong

public void writeFixedLong(long l)

writeUTF

public void writeUTF(String s)
              throws IOException
Throws:
IOException


Copyright (C) Wolfgang Meier. All rights reserved.