public interface HecFile
Construct a HecFile using a FilePath Object or with a RmiFileImpl RemoteWrapper.
Use getBufferedReader for UNICODE Reading of a HecFile.
Use getBufferedWriter for UNICODE Writing of a HecFile.
NOTE - the writing must be followed by a save() to send the byte[] to the RmiFileImpl.
RmiFileImpl,
FilePath| Modifier and Type | Method and Description |
|---|---|
boolean |
appendByteArray(byte[] byteArray)
Appends byteArray to the end of this file.
|
boolean |
canRead()
Tests whether the application can read the file denoted by this HecFile.
|
boolean |
canWrite()
Tests whether the application can modify the file denoted by this HecFile.
|
void |
close()
Closes any open writers and flushes their data to disk.
|
boolean |
exists()
Tests whether the file denoted by this HecFile exists.
|
java.io.BufferedWriter |
getAppendedBufferedWriter()
Get a BufferedWriter to append to the end of this file.
|
java.io.DataOutputStream |
getAppendedDataOutputStream()
Get a DataOutputStream for appending to the end of this file.
|
java.io.BufferedReader |
getBufferedReader()
Get a BufferedReader for this file.
|
java.io.BufferedWriter |
getBufferedWriter()
Get a BufferedWriter to write to this file.
|
byte[] |
getByteArray()
Get the byte[] representing this HecFile's data.
|
byte[] |
getByteArray(long off,
int len)
Get the byte[] representing this HecFile's data starting at offset for
the length amount.
|
java.io.ByteArrayInputStream |
getByteArrayInputStream()
Get a ByteArrayInputStream for this file.
|
java.io.ByteArrayOutputStream |
getByteArrayOutputStream()
Get a ByteArrayOutputStream for this file.
|
long |
getCheckSum()
Get the check sum for this file.
|
java.io.DataInputStream |
getDataInputStream()
Get a DataInputStream for this file.
|
java.io.DataOutputStream |
getDataOutputStream()
Get a DataOutputStream for writing to this file.
|
EndianInputStream |
getEndianInputStream()
Get an EndianInputStream for this file.
|
EndianOutputStream |
getEndianOutputStream()
Get an EndianOutputStream for this file.
|
java.lang.String |
getName()
Sets the name of the file.
|
java.io.ObjectInputStream |
getObjectInputStream()
Get an ObjectInputStream for this file.
|
java.io.ObjectOutputStream |
getObjectOutputStream()
Get an ObjectOutputStream for this file.
|
java.lang.String |
getPath()
Converts this HecFile into a pathname String.
|
boolean |
getUsingCompression()
return whether this
HecFile is using Compression to read/write
data to the RmiFile |
boolean |
isDirectory()
Tests whether the file denoted by this HecFile is a directory.
|
boolean |
isFile()
Tests whether the file denoted by this HecFile is a normal file.
|
boolean |
isNetworked()
Get whether this HecFile represents a networked or local file.
|
long |
lastModified()
Returns the time that the file denoted by this HecFile was last modified.
|
long |
length()
Returns the length of the file denoted by this HecFile.
|
boolean |
lockFile(FileLock fLock)
Lock this file with fLock.
|
boolean |
mkdirs()
Creates the directory named by this HecFile, including any necessary but
nonexistent parent directories.
|
void |
notify(java.lang.String message)
Send message to all callback objects registered with this file.
|
boolean |
save()
Save the contents of any writers that are currently in use.
|
boolean |
setByteArray(byte[] byteArray)
Set this HecFile's data to byteArray starting at the beginning of the file
|
void |
setUseCompression(boolean compress)
set whether this
HecFile should use compression to read/write
data to/from the RmiFile |
boolean |
unlockFile(FileLock fLock)
Unlock this file with fLock.
|
void |
writeBytes(long bytePos,
byte[] bytes) |
void |
writeFloat(long bytePos,
float f)
Write a float f to position bytePos in this HecFile.
|
boolean isDirectory()
java.lang.String getName()
java.lang.String getPath()
boolean canRead()
boolean isFile()
boolean exists()
boolean canWrite()
boolean mkdirs()
long length()
long lastModified()
byte[] getByteArray()
byte[] getByteArray(long off,
int len)
offset - the offset into the file's datalength - the number of bytes to return. The actual number returned
may be less if the file isn't offset+length long.boolean setByteArray(byte[] byteArray)
byteArray - the file's new databoolean appendByteArray(byte[] byteArray)
byteArray - the bytes to append to the end of this file.java.io.BufferedWriter getBufferedWriter()
java.io.BufferedWriter getAppendedBufferedWriter()
java.io.DataOutputStream getDataOutputStream()
java.io.DataOutputStream getAppendedDataOutputStream()
java.io.DataInputStream getDataInputStream()
java.io.ObjectOutputStream getObjectOutputStream()
throws java.io.IOException
java.io.IOExceptionjava.io.ObjectInputStream getObjectInputStream()
java.io.ByteArrayOutputStream getByteArrayOutputStream()
java.io.ByteArrayInputStream getByteArrayInputStream()
EndianInputStream getEndianInputStream()
EndianOutputStream getEndianOutputStream()
boolean save()
java.io.BufferedReader getBufferedReader()
void notify(java.lang.String message)
message - The notification message.void close()
throws java.io.IOException
java.io.IOExceptionlong getCheckSum()
CRC32boolean isNetworked()
boolean lockFile(FileLock fLock)
fLock - The type of FileLock to use to lock this HecFile.boolean unlockFile(FileLock fLock)
fLock - The type of FileLock to use to unlock this HecFile.void setUseCompression(boolean compress)
HecFile should use compression to read/write
data to/from the RmiFilecompress - whether to use compression or notRmiFile#setByteArray,
RmiFile#appendByteArray,
RmiFile#getByteArrayboolean getUsingCompression()
HecFile is using Compression to read/write
data to the RmiFileRmiFile#setByteArray,
RmiFile#appendByteArray,
RmiFile#getByteArrayvoid writeFloat(long bytePos,
float f)
bytePos - The position in the file to write f.f - The float to write.void writeBytes(long bytePos,
byte[] bytes)