|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectbinaryFileStorage.BinaryOutputStream
public class BinaryOutputStream
Handles writing of an actual binary data file.
Is used during data analysis and also to rewrite files if they are changed during offline analysis using the PAMGUARD viewer.
BinaryStore| Field Summary | |
|---|---|
private BinaryDataSource |
binaryDataSource
|
private BinaryStore |
binaryStore
|
private java.io.DataOutputStream |
dataOutputStream
|
private BinaryFooter |
footer
|
private BinaryHeader |
header
|
private java.lang.String |
indexFileName
|
private java.lang.String |
mainFileName
|
private byte[] |
moduleFooterData
|
private byte[] |
moduleHeaderData
|
private PamDataBlock |
parentDataBlock
|
private int |
storedObjects
|
| Constructor Summary | |
|---|---|
BinaryOutputStream(BinaryStore binaryStore,
PamDataBlock parentDataBlock)
|
|
| Method Summary | |
|---|---|
boolean |
closeFile()
|
private boolean |
createFileNames(long dataTime)
Create names for the main storage file and also for the corresponding index file. |
boolean |
createIndexFile()
|
boolean |
createIndexFile(java.io.File indexFile)
|
private java.lang.String |
fillSpaces(java.lang.String str)
Fill blank spaces in a string. |
protected void |
finalize()
|
private long |
getSamplesFromMilliseconds(long timeMillis)
|
boolean |
openFile(java.io.File outputFile)
Open an output file. |
boolean |
openFile(long dataTime)
Open an output file. |
protected void |
reOpen(long dataTime,
long analTime,
int endReason)
|
boolean |
storeData(BinaryObjectData binaryObjectData)
Write data to a file. |
boolean |
storeData(int objectId,
long timeMillis,
byte[] data)
Write data to a file |
boolean |
storeData(int objectId,
long timeMillis,
byte[] data,
int objectLength)
Writes data to a file. |
boolean |
writeFooter(long dataTime,
long analTime,
int endReason)
|
boolean |
writeHeader(long dataTime,
long analTime)
|
boolean |
writeModuleFooter()
|
boolean |
writeModuleFooter(byte[] footerData)
|
boolean |
writeModuleFooter(java.io.DataOutputStream outputStream,
byte[] footerData)
|
boolean |
writeModuleHeader()
|
boolean |
writeModuleHeader(byte[] headerData)
|
boolean |
writeModuleHeader(java.io.DataOutputStream outputStream,
byte[] headerData)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private PamDataBlock parentDataBlock
private BinaryDataSource binaryDataSource
private BinaryStore binaryStore
private BinaryHeader header
private BinaryFooter footer
private byte[] moduleHeaderData
private byte[] moduleFooterData
private java.io.DataOutputStream dataOutputStream
private int storedObjects
private java.lang.String mainFileName
private java.lang.String indexFileName
| Constructor Detail |
|---|
public BinaryOutputStream(BinaryStore binaryStore,
PamDataBlock parentDataBlock)
| Method Detail |
|---|
protected void finalize()
throws java.lang.Throwable
finalize in class java.lang.Objectjava.lang.Throwable
protected void reOpen(long dataTime,
long analTime,
int endReason)
public boolean openFile(long dataTime)
this call is used in real time ops to create a new file name based on the time and information from the datablock name.
dataTime - time in Java milliseconds
public boolean openFile(java.io.File outputFile)
This version is used when rewriting files when data have been changed offline. Generally the file will be a .tmp file
outputFile - output file
private boolean createFileNames(long dataTime)
dataTime - time in milliseconds.
private java.lang.String fillSpaces(java.lang.String str)
str -
public boolean closeFile()
private long getSamplesFromMilliseconds(long timeMillis)
public boolean writeHeader(long dataTime,
long analTime)
public boolean writeModuleHeader()
public boolean writeModuleHeader(byte[] headerData)
public boolean writeModuleHeader(java.io.DataOutputStream outputStream,
byte[] headerData)
public boolean writeModuleFooter()
public boolean writeModuleFooter(byte[] footerData)
public boolean writeModuleFooter(java.io.DataOutputStream outputStream,
byte[] footerData)
public boolean writeFooter(long dataTime,
long analTime,
int endReason)
public boolean storeData(int objectId,
long timeMillis,
byte[] data)
objectId - unique object identifier.timeMillis - time of object in java millisecondsdata - byte array of binary data to store.
public boolean storeData(BinaryObjectData binaryObjectData)
binaryObjectData - data to store.
public boolean storeData(int objectId,
long timeMillis,
byte[] data,
int objectLength)
objectId - unique object identifier.timeMillis - time of object in java millisecondsdata - byte array of binary data to store.objectLength - length of useful data in data (often = data.length)
public boolean createIndexFile()
public boolean createIndexFile(java.io.File indexFile)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||