FreeHEP API
Version current

hep.io.root.core
Class RootRandomAccessFile

java.lang.Object
  extended byjava.io.RandomAccessFile
      extended byhep.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)
Source Code:
RootRandomAccessFile.java

Constructor Summary
RootRandomAccessFile(File file, RootFileReader reader)
           
 
Method Summary
 void checkLength(AbstractRootObject obj)
           
 void clearMap()
           
 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)
           
 void readFixedArray(byte[] data)
           
 void readFixedArray(double[] data)
           
 void readFixedArray(float[] data)
           
 void readFixedArray(int[] data)
           
 void readFixedArray(long[] 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)
           
 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.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 hep.io.root.core.RootInput
close
 
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
Throws:
IOException

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

readArray

public int readArray(int[] 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(short[] 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(double[] data)
              throws IOException
Specified by:
readArray 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(byte[] 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

readFixedArray

public void readFixedArray(float[] 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

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

readString

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

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

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

dump

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

Specified by:
dump 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

FreeHEP API
Version current

Copyright © 2000-2004 FreeHEP, All Rights Reserved.