org.mbari.siam.core
Class DeviceLogData

java.lang.Object
  extended by org.mbari.siam.core.DeviceLogData

public class DeviceLogData
extends java.lang.Object

This class implements the serialized class storage and retrieval functions needed by the DeviceLog class.

Author:
Tim Meese
See Also:
DeviceLog

Field Summary
protected  long _currentDataFileExtent
           
protected  java.io.RandomAccessFile _dataFile
           
protected  long _deviceId
           
protected  int _segment
           
 
Constructor Summary
protected DeviceLogData(long deviceId, int segmentNumber, java.lang.String directory)
          default constructor
protected DeviceLogData(long deviceId, int segmentNumber, java.lang.String suffix, java.lang.String directory)
           
 
Method Summary
protected  void appendLogData(byte[] serializedData, DeviceLogIndex.Entry indexEntry)
          this routine appends a byte array of serialized class data to the data log according to the information contained in the DeviceLogIndex.Entry that is passed in
protected  void close()
          Close the data file.
protected  java.io.FileInputStream getFileInputStream()
           
protected  long getFilePointer()
           
protected  long getLength()
           
protected  int readBytes(byte[] buf, int offset, int bytes)
           
protected  byte[] readLogData(DeviceLogIndex.Entry indexEntry)
          this routine reads a byte array of serialized class data from the data log according to the information contained in the DeviceLogIndex.Entry that is passed in
protected  void seek(long pos)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_dataFile

protected java.io.RandomAccessFile _dataFile

_deviceId

protected long _deviceId

_segment

protected int _segment

_currentDataFileExtent

protected long _currentDataFileExtent
Constructor Detail

DeviceLogData

protected DeviceLogData(long deviceId,
                        int segmentNumber,
                        java.lang.String directory)
                 throws java.io.FileNotFoundException,
                        java.io.IOException
default constructor

Parameters:
deviceId - ISI Device ID
segmentNumber - segment number
Throws:
java.io.FileNotFoundException
java.io.IOException

DeviceLogData

protected DeviceLogData(long deviceId,
                        int segmentNumber,
                        java.lang.String suffix,
                        java.lang.String directory)
                 throws java.io.FileNotFoundException,
                        java.io.IOException
Throws:
java.io.FileNotFoundException
java.io.IOException
Method Detail

appendLogData

protected void appendLogData(byte[] serializedData,
                             DeviceLogIndex.Entry indexEntry)
this routine appends a byte array of serialized class data to the data log according to the information contained in the DeviceLogIndex.Entry that is passed in

Parameters:
indexEntry - index entry used to write data
See Also:
DeviceLogIndex.Entry

readLogData

protected byte[] readLogData(DeviceLogIndex.Entry indexEntry)
this routine reads a byte array of serialized class data from the data log according to the information contained in the DeviceLogIndex.Entry that is passed in

Parameters:
indexEntry - index entry used to read data
See Also:
DeviceLogIndex.Entry

close

protected void close()
              throws java.io.IOException
Close the data file. This DeviceLogData instance is no longer usable after close() has been called.

Throws:
java.io.IOException

seek

protected void seek(long pos)
             throws java.io.IOException
Throws:
java.io.IOException

getLength

protected long getLength()
                  throws java.io.IOException
Throws:
java.io.IOException

getFilePointer

protected long getFilePointer()
                       throws java.io.IOException
Throws:
java.io.IOException

readBytes

protected int readBytes(byte[] buf,
                        int offset,
                        int bytes)
                 throws java.io.IOException
Throws:
java.io.IOException

getFileInputStream

protected java.io.FileInputStream getFileInputStream()
                                              throws java.io.IOException
Throws:
java.io.IOException


Copyright © 2003 MBARI.

The Monterey Bay Aquarium Research Institute (MBARI) provides this documentation and code "as is", with no warranty, express or implied, of its quality or consistency. It is provided without support and without obligation on the part of MBARI to assist in its use, correction, modification, or enhancement.