FreeHEP API
Version v1.2.2

hep.io.root.core
Class RootRandomAccessFile

java.lang.Object
  |
  +--java.io.RandomAccessFile
        |
        +--hep.io.root.core.RootRandomAccessFile
All Implemented Interfaces:
DataInput, DataOutput, RootInput

public class RootRandomAccessFile
extends RandomAccessFile
implements RootInput

Version:
$Id
Author:
Tony Johnson (tonyj@slac.stanford.edu)

Constructor Summary
RootRandomAccessFile(File file, RootFileReader reader)
           
 
Method Summary
 void checkLength(AbstractRootObject obj)
           
 void clearMap()
           
 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)
           
 void readFixedArray(byte[] data)
           
 void readFixedArray(double[] data)
           
 void readFixedArray(float[] data)
           
 void readFixedArray(int[] data)
           
 void readFixedArray(short[] data)
           
 void readMultiArray(Object[] array)
           
 String readNullTerminatedString(int maxLength)
           
 RootObject readObject(String type)
           
 RootObject readObjectRef()
           
 String readString()
           
 double readTwistedDouble()
          Reads a double in strange byte order?
 int readVersion()
           
 int readVersion(AbstractRootObject obj)
           
 void setMap(int keylen)
           
 void setPosition(long pos)
           
 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.io.RandomAccessFile
close, getChannel, getFD, getFilePointer, length, read, read, read, readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF, seek, setLength, skipBytes, write, write, write, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTF
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.io.DataInput
readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF, skipBytes
 

Constructor Detail

RootRandomAccessFile

public RootRandomAccessFile(File file,
                            RootFileReader reader)
                     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 keylen)
            throws IOException
Specified by:
setMap in interface RootInput
IOException

setPosition

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

getPosition

public long getPosition()
                 throws IOException
Specified by:
getPosition in interface RootInput
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
IOException

clearMap

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

readArray

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

readArray

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

readArray

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

readArray

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

readArray

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

readFixedArray

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

readFixedArray

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

readFixedArray

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

readFixedArray

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

readFixedArray

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

readMultiArray

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

readNullTerminatedString

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

readObject

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

readObjectRef

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

readString

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

readVersion

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

readVersion

public int readVersion(AbstractRootObject obj)
                throws IOException
Specified by:
readVersion in interface RootInput
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
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
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
IOException

FreeHEP API
Version v1.2.2

Copyright © 2000-2003 FreeHEP, All Rights Reserved.