public class BinaryOutputStream
extends java.lang.Object
Is used during data analysis and also to rewrite files if they are changed during offline analysis using the PAMGUARD viewer.
BinaryStore
Constructor and Description |
---|
BinaryOutputStream(BinaryStore binaryStore,
PamDataBlock parentDataBlock) |
Modifier and Type | Method and Description |
---|---|
boolean |
closeFile() |
boolean |
createIndexFile() |
boolean |
createIndexFile(java.io.File indexFile) |
long |
getFileSize() |
java.lang.String |
getMainFileName() |
boolean |
openFile(java.io.File outputFile)
Open an output file.
|
boolean |
openFile(long dataTime)
Open an output file.
|
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 |
writeDatagram(Datagram datagram)
Write a Datagram to an output stream
|
boolean |
writeFileFooter(BinaryFooter footer)
Write a file footer to the binary output stream.
|
boolean |
writeFooter(long dataTime,
long analTime,
int endReason) |
boolean |
writeHeader(long dataTime,
long analTime) |
boolean |
writeModuleFooter() |
boolean |
writeModuleFooter(byte[] footerData)
Write module footer data to the output stream.
|
boolean |
writeModuleFooter(java.io.DataOutputStream outputStream,
byte[] footerData)
Write module footer data to a specific output stream.
|
boolean |
writeModuleFooter(ModuleFooter moduleFooter)
Write a module footer to the output stream.
|
boolean |
writeModuleHeader() |
boolean |
writeModuleHeader(byte[] headerData) |
boolean |
writeModuleHeader(java.io.DataOutputStream outputStream,
byte[] headerData) |
public BinaryOutputStream(BinaryStore binaryStore, PamDataBlock parentDataBlock)
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 millisecondspublic 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 filepublic boolean closeFile()
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(ModuleFooter moduleFooter)
moduleFooter
- module footerpublic boolean writeModuleFooter(byte[] footerData)
footerData
- footer data as a binary arraypublic boolean writeModuleFooter(java.io.DataOutputStream outputStream, byte[] footerData)
outputStream
- output streamfooterData
- footer data in a binary arraypublic boolean writeFooter(long dataTime, long analTime, int endReason)
public long getFileSize()
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)
public boolean writeDatagram(Datagram datagram)
datagram
- Datagram
public boolean writeFileFooter(BinaryFooter footer)
footer
- file footer.public java.lang.String getMainFileName()