org.exist.storage.io
Interface VariableByteInput

All Known Implementing Classes:
AbstractVariableByteInput, VariableByteArrayInput, VariableByteInputStream

public interface VariableByteInput

Interface for reading variable byte encoded values. Variable byte encoding offers a good compression ratio if the stored values are rather small, i.e. much smaller than the possible maximum for the given type.

Author:
wolf

Method Summary
 int available()
          Returns a value > 0 if more bytes can be read from the input.
 void copyRaw(VariableByteOutputStream os, int bytes)
           
 void copyTo(VariableByteOutputStream os)
          Copy the next numeric value from the input to the specified output stream.
 void copyTo(VariableByteOutputStream os, int count)
          Copy the count next numeric values from the input to the specified output stream.
 int read()
          Read a single byte and return as an int value.
 int read(byte[] data)
          Fill the provided byte array with data from the input.
 int read(byte[] b, int off, int len)
           
 byte readByte()
          Read a single byte.
 int readFixedInt()
           
 int readInt()
          Read an integer value in variable byte encoding.
 long readLong()
          Read a long value in variable byte encoding.
 short readShort()
          Read a short value in variable byte encoding.
 String readUTF()
           
 void skip(int count)
          Read the following count numeric values from the input and drop them.
 void skipBytes(long count)
           
 

Method Detail

read

int read()
         throws IOException
Read a single byte and return as an int value.

Returns:
the byte value as int or -1 if no more bytes are available.
Throws:
IOException

read

int read(byte[] data)
         throws IOException
Fill the provided byte array with data from the input.

Parameters:
data -
Throws:
IOException

read

int read(byte[] b,
         int off,
         int len)
         throws IOException
Throws:
IOException

available

int available()
              throws IOException
Returns a value > 0 if more bytes can be read from the input.

Throws:
IOException

readByte

byte readByte()
              throws IOException
Read a single byte. Throws EOFException if no more bytes are available.

Throws:
IOException

readShort

short readShort()
                throws IOException
Read a short value in variable byte encoding.

Throws:
IOException

readInt

int readInt()
            throws IOException
Read an integer value in variable byte encoding.

Throws:
IOException

readFixedInt

int readFixedInt()
                 throws IOException
Throws:
IOException

readLong

long readLong()
              throws IOException
Read a long value in variable byte encoding.

Throws:
IOException

readUTF

String readUTF()
               throws IOException,
                      EOFException
Throws:
IOException
EOFException

skip

void skip(int count)
          throws IOException
Read the following count numeric values from the input and drop them.

Parameters:
count -
Throws:
IOException

skipBytes

void skipBytes(long count)
               throws IOException
Throws:
IOException

copyTo

void copyTo(VariableByteOutputStream os)
            throws IOException
Copy the next numeric value from the input to the specified output stream.

Parameters:
os -
Throws:
IOException

copyTo

void copyTo(VariableByteOutputStream os,
            int count)
            throws IOException
Copy the count next numeric values from the input to the specified output stream.

Parameters:
os -
count -
Throws:
IOException

copyRaw

void copyRaw(VariableByteOutputStream os,
             int bytes)
             throws IOException
Throws:
IOException


Copyright (C) Wolfgang Meier. All rights reserved.