org.exist.storage.io
Class VariableByteArrayInput

java.lang.Object
  extended by org.exist.storage.io.AbstractVariableByteInput
      extended by org.exist.storage.io.VariableByteArrayInput
All Implemented Interfaces:
VariableByteInput

public class VariableByteArrayInput
extends AbstractVariableByteInput

Implements VariableByteInput on top of a byte array.

Author:
wolf

Constructor Summary
VariableByteArrayInput()
           
VariableByteArrayInput(byte[] data)
           
VariableByteArrayInput(byte[] data, int offset, int length)
           
 
Method Summary
 int available()
          Returns a value > 0 if more bytes can be read from the input.
 void copyRaw(VariableByteOutputStream os, int count)
           
 void copyTo(VariableByteOutputStream os, int count)
          Copy the count next numeric values from the input to the specified output stream.
 void initialize(byte[] data, int offset, int length)
           
 int read()
          Read a single byte and return as an int value.
 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)
           
 String toString(int len)
           
 
Methods inherited from class org.exist.storage.io.AbstractVariableByteInput
copyTo, read, read, release
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VariableByteArrayInput

public VariableByteArrayInput()

VariableByteArrayInput

public VariableByteArrayInput(byte[] data)

VariableByteArrayInput

public VariableByteArrayInput(byte[] data,
                              int offset,
                              int length)
Method Detail

initialize

public void initialize(byte[] data,
                       int offset,
                       int length)

readByte

public byte readByte()
              throws IOException,
                     EOFException
Description copied from interface: VariableByteInput
Read a single byte. Throws EOFException if no more bytes are available.

Specified by:
readByte in interface VariableByteInput
Overrides:
readByte in class AbstractVariableByteInput
Throws:
IOException
EOFException

read

public int read()
         throws IOException
Description copied from interface: VariableByteInput
Read a single byte and return as an int value.

Specified by:
read in interface VariableByteInput
Specified by:
read in class AbstractVariableByteInput
Returns:
the byte value as int or -1 if no more bytes are available.
Throws:
IOException

available

public int available()
              throws IOException
Description copied from interface: VariableByteInput
Returns a value > 0 if more bytes can be read from the input.

Specified by:
available in interface VariableByteInput
Specified by:
available in class AbstractVariableByteInput
Throws:
IOException

readShort

public short readShort()
                throws IOException
Description copied from interface: VariableByteInput
Read a short value in variable byte encoding.

Specified by:
readShort in interface VariableByteInput
Overrides:
readShort in class AbstractVariableByteInput
Throws:
IOException

readInt

public int readInt()
            throws IOException
Description copied from interface: VariableByteInput
Read an integer value in variable byte encoding.

Specified by:
readInt in interface VariableByteInput
Overrides:
readInt in class AbstractVariableByteInput
Throws:
IOException

readFixedInt

public int readFixedInt()
                 throws IOException
Specified by:
readFixedInt in interface VariableByteInput
Overrides:
readFixedInt in class AbstractVariableByteInput
Throws:
IOException

readLong

public long readLong()
              throws IOException
Description copied from interface: VariableByteInput
Read a long value in variable byte encoding.

Specified by:
readLong in interface VariableByteInput
Overrides:
readLong in class AbstractVariableByteInput
Throws:
IOException

readUTF

public String readUTF()
               throws IOException,
                      EOFException
Specified by:
readUTF in interface VariableByteInput
Overrides:
readUTF in class AbstractVariableByteInput
Throws:
IOException
EOFException

copyTo

public void copyTo(VariableByteOutputStream os,
                   int count)
            throws IOException
Description copied from interface: VariableByteInput
Copy the count next numeric values from the input to the specified output stream.

Specified by:
copyTo in interface VariableByteInput
Overrides:
copyTo in class AbstractVariableByteInput
Throws:
IOException

copyRaw

public void copyRaw(VariableByteOutputStream os,
                    int count)
             throws IOException
Specified by:
copyRaw in interface VariableByteInput
Overrides:
copyRaw in class AbstractVariableByteInput
Throws:
IOException

skip

public void skip(int count)
          throws IOException
Description copied from interface: VariableByteInput
Read the following count numeric values from the input and drop them.

Specified by:
skip in interface VariableByteInput
Overrides:
skip in class AbstractVariableByteInput
Throws:
IOException

skipBytes

public void skipBytes(long count)
               throws IOException
Specified by:
skipBytes in interface VariableByteInput
Overrides:
skipBytes in class AbstractVariableByteInput
Throws:
IOException

toString

public String toString(int len)


Copyright (C) Wolfgang Meier. All rights reserved.