FreeHEP API
Version current

hep.io.root.core
Class FastInputStream

java.lang.Object
  extended byhep.io.root.core.FastInputStream
All Implemented Interfaces:
DataInput, RootInput

public class FastInputStream
extends Object
implements RootInput

Version:
$Id: FastInputStream.java,v 1.6 2005/08/10 00:56:30 tonyj Exp $
Author:
tonyj
Source Code:
FastInputStream.java

Constructor Summary
FastInputStream(RootFileReader rfr, RandomAccessFile raf)
           
 
Method Summary
 void checkLength(AbstractRootObject obj)
           
 void clearMap()
           
 void close()
           
 void dump()
          For debugging
 RootClassFactory getFactory()
           
 long getPosition()
           
 int getRootVersion()
          Returns the Root version which wrote this file
 RootInput getTop()
          Returns the RootInput at the top of top of the heirarchy of slices
 int readArray(byte[] data)
           
 int readArray(double[] data)
           
 int readArray(float[] data)
           
 int readArray(int[] data)
           
 int readArray(short[] data)
           
 boolean readBoolean()
           
 byte readByte()
           
 char readChar()
           
 double readDouble()
           
 void readFixedArray(byte[] data)
           
 void readFixedArray(double[] data)
           
 void readFixedArray(float[] data)
           
 void readFixedArray(int[] data)
           
 void readFixedArray(long[] data)
           
 void readFixedArray(short[] data)
           
 float readFloat()
           
 void readFully(byte[] values)
           
 void readFully(byte[] values, int param, int param2)
           
 int readInt()
           
 String readLine()
           
 long readLong()
           
 void readMultiArray(Object[] array)
           
 String readNullTerminatedString(int maxLength)
           
 RootObject readObject(String type)
           
 RootObject readObjectRef()
           
 short readShort()
           
 String readString()
           
 double readTwistedDouble()
          Reads a double in strange byte order?
 int readUnsignedByte()
           
 int readUnsignedShort()
           
 String readUTF()
           
 int readVersion()
           
 int readVersion(AbstractRootObject obj)
           
 void setMap(int offset)
           
 void setPosition(long pos)
           
 int skipBytes(int param)
           
 void skipObject()
          For skipping uninterpretable objects
 RootInput slice(int size)
          Returns a new RootInput stream which represents a slice of this RootInput stream.
 RootInput slice(int inSize, int outSize)
          Slice and decompress
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FastInputStream

public FastInputStream(RootFileReader rfr,
                       RandomAccessFile raf)
                throws IOException
Method Detail

getFactory

public RootClassFactory getFactory()
Specified by:
getFactory in interface RootInput
Returns:
The RootClassFactory associated with this stream

setMap

public void setMap(int offset)
Specified by:
setMap in interface RootInput

setPosition

public void setPosition(long pos)
                 throws IOException
Specified by:
setPosition in interface RootInput
Throws:
IOException

getPosition

public long getPosition()
                 throws IOException
Specified by:
getPosition in interface RootInput
Throws:
IOException

getRootVersion

public int getRootVersion()
Description copied from interface: RootInput
Returns the Root version which wrote this file

Specified by:
getRootVersion in interface RootInput

getTop

public RootInput getTop()
Description copied from interface: RootInput
Returns the RootInput at the top of top of the heirarchy of slices

Specified by:
getTop in interface RootInput

checkLength

public void checkLength(AbstractRootObject obj)
                 throws IOException
Specified by:
checkLength in interface RootInput
Throws:
IOException

clearMap

public void clearMap()
Specified by:
clearMap in interface RootInput

dump

public void dump()
Description copied from interface: RootInput
For debugging

Specified by:
dump in interface RootInput

readArray

public int readArray(short[] data)
              throws IOException
Specified by:
readArray in interface RootInput
Throws:
IOException

readArray

public int readArray(byte[] data)
              throws IOException
Specified by:
readArray in interface RootInput
Throws:
IOException

readArray

public int readArray(double[] data)
              throws IOException
Specified by:
readArray in interface RootInput
Throws:
IOException

readArray

public int readArray(float[] data)
              throws IOException
Specified by:
readArray in interface RootInput
Throws:
IOException

readArray

public int readArray(int[] data)
              throws IOException
Specified by:
readArray in interface RootInput
Throws:
IOException

readBoolean

public boolean readBoolean()
                    throws IOException
Specified by:
readBoolean in interface DataInput
Throws:
IOException

readByte

public byte readByte()
              throws IOException
Specified by:
readByte in interface DataInput
Throws:
IOException

readChar

public char readChar()
              throws IOException
Specified by:
readChar in interface DataInput
Throws:
IOException

readDouble

public double readDouble()
                  throws IOException
Specified by:
readDouble in interface DataInput
Throws:
IOException

readTwistedDouble

public double readTwistedDouble()
                         throws IOException
Description copied from interface: RootInput
Reads a double in strange byte order?

Specified by:
readTwistedDouble in interface RootInput
Throws:
IOException

readFixedArray

public void readFixedArray(byte[] data)
                    throws IOException
Specified by:
readFixedArray in interface RootInput
Throws:
IOException

readFixedArray

public void readFixedArray(double[] data)
                    throws IOException
Specified by:
readFixedArray in interface RootInput
Throws:
IOException

readFixedArray

public void readFixedArray(int[] data)
                    throws IOException
Specified by:
readFixedArray in interface RootInput
Throws:
IOException

readFixedArray

public void readFixedArray(long[] data)
                    throws IOException
Specified by:
readFixedArray in interface RootInput
Throws:
IOException

readFixedArray

public void readFixedArray(float[] data)
                    throws IOException
Specified by:
readFixedArray in interface RootInput
Throws:
IOException

readFixedArray

public void readFixedArray(short[] data)
                    throws IOException
Specified by:
readFixedArray in interface RootInput
Throws:
IOException

readFloat

public float readFloat()
                throws IOException
Specified by:
readFloat in interface DataInput
Throws:
IOException

readFully

public void readFully(byte[] values)
               throws IOException
Specified by:
readFully in interface DataInput
Throws:
IOException

readFully

public void readFully(byte[] values,
                      int param,
                      int param2)
               throws IOException
Specified by:
readFully in interface DataInput
Throws:
IOException

readInt

public int readInt()
            throws IOException
Specified by:
readInt in interface DataInput
Throws:
IOException

readLine

public String readLine()
                throws IOException
Specified by:
readLine in interface DataInput
Throws:
IOException

readLong

public long readLong()
              throws IOException
Specified by:
readLong in interface DataInput
Throws:
IOException

readMultiArray

public void readMultiArray(Object[] array)
                    throws IOException
Specified by:
readMultiArray in interface RootInput
Throws:
IOException

readNullTerminatedString

public String readNullTerminatedString(int maxLength)
                                throws IOException
Specified by:
readNullTerminatedString in interface RootInput
Throws:
IOException

readObject

public RootObject readObject(String type)
                      throws IOException
Specified by:
readObject in interface RootInput
Throws:
IOException

readObjectRef

public RootObject readObjectRef()
                         throws IOException
Specified by:
readObjectRef in interface RootInput
Throws:
IOException

readShort

public short readShort()
                throws IOException
Specified by:
readShort in interface DataInput
Throws:
IOException

readString

public String readString()
                  throws IOException
Specified by:
readString in interface RootInput
Throws:
IOException

readUTF

public String readUTF()
               throws IOException
Specified by:
readUTF in interface DataInput
Throws:
IOException

readUnsignedByte

public int readUnsignedByte()
                     throws IOException
Specified by:
readUnsignedByte in interface DataInput
Throws:
IOException

readUnsignedShort

public int readUnsignedShort()
                      throws IOException
Specified by:
readUnsignedShort in interface DataInput
Throws:
IOException

readVersion

public int readVersion()
                throws IOException
Specified by:
readVersion in interface RootInput
Throws:
IOException

readVersion

public int readVersion(AbstractRootObject obj)
                throws IOException
Specified by:
readVersion in interface RootInput
Throws:
IOException

skipObject

public void skipObject()
                throws IOException
Description copied from interface: RootInput
For skipping uninterpretable objects

Specified by:
skipObject in interface RootInput
Throws:
IOException

skipBytes

public int skipBytes(int param)
              throws IOException
Specified by:
skipBytes in interface DataInput
Throws:
IOException

slice

public RootInput slice(int size)
                throws IOException
Description copied from interface: RootInput
Returns a new RootInput stream which represents a slice of this RootInput stream. The new RootInput maintains its own file position independent of the parent stream. The slice starts from the current file position and extends for size bytes.

Specified by:
slice in interface RootInput
Parameters:
size - The size of the slice.
Returns:
The slice
Throws:
IOException

slice

public RootInput slice(int inSize,
                       int outSize)
                throws IOException
Description copied from interface: RootInput
Slice and decompress

Specified by:
slice in interface RootInput
Throws:
IOException

close

public void close()
           throws IOException
Specified by:
close in interface RootInput
Throws:
IOException

FreeHEP API
Version current

Copyright © 2000-2004 FreeHEP, All Rights Reserved.