Package hec.util
Class SimpleFile
java.lang.Object
java.io.File
hec.util.SimpleFile
- All Implemented Interfaces:
hec.io.HecFile,Serializable,Comparable<File>
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static booleanDefault value for write to a tmp file.protected booleanwhether to write to a tmp file instead of the real file during writesprotected static final Stringextension used for backup filesprotected static final Stringextension used for temp filesFields inherited from class java.io.File
pathSeparator, pathSeparatorChar, separator, separatorChar -
Constructor Summary
ConstructorsConstructorDescriptionSimpleFile(File parent, String child) SimpleFile(String pathname) SimpleFile(String parent, String child) -
Method Summary
Modifier and TypeMethodDescriptionbooleanappendByteArray(byte[] byteArray) voidclose()protected voidcopies src to dest - does no checking of the files.byte[]byte[]getByteArray(boolean compress) Return a byte[] containing the data from the File.byte[]getByteArray(long off, int len) longhec.io.EndianInputStreamhec.io.EndianOutputStreambooleanbooleanbooleanlockFile(hec.io.FileLock fLock) voidbooleansave()booleansetByteArray(byte[] byteArray) voidsetUseCompression(boolean compress) static voidsetWriteToTmpFile(boolean writeToTmp) booleanunlockFile(hec.io.FileLock fLock) voidwriteBytes(long bytePos, byte[] bytes) voidwriteFloat(long bytePos, float f) Methods inherited from class java.io.File
canExecute, canRead, canWrite, compareTo, createNewFile, createTempFile, createTempFile, delete, deleteOnExit, equals, exists, getAbsoluteFile, getAbsolutePath, getCanonicalFile, getCanonicalPath, getFreeSpace, getName, getParent, getParentFile, getPath, getTotalSpace, getUsableSpace, hashCode, isAbsolute, isDirectory, isFile, isHidden, lastModified, length, list, list, listFiles, listFiles, listFiles, listRoots, mkdir, mkdirs, renameTo, setExecutable, setExecutable, setLastModified, setReadable, setReadable, setReadOnly, setWritable, setWritable, toPath, toString, toURI, toURLMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface hec.io.HecFile
canRead, canWrite, exists, getLineSeparator, getName, getPath, isDirectory, isFile, lastModified, length, mkdirs
-
Field Details
-
TMP_EXTENSION
extension used for temp files- See Also:
-
BAK_EXTENSION
extension used for backup files- See Also:
-
_staticWriteToTmpDefault
protected static boolean _staticWriteToTmpDefaultDefault value for write to a tmp file. -
_writeToTmp
protected boolean _writeToTmpwhether to write to a tmp file instead of the real file during writes
-
-
Constructor Details
-
SimpleFile
- Parameters:
parent-child-
-
SimpleFile
-
SimpleFile
-
-
Method Details
-
setWriteToTmpFile
public static void setWriteToTmpFile(boolean writeToTmp) -
appendByteArray
public boolean appendByteArray(byte[] byteArray) - Specified by:
appendByteArrayin interfacehec.io.HecFile- Parameters:
byteArray-- Returns:
- See Also:
-
copyFile
copies src to dest - does no checking of the files.- Throws:
IOException
-
close
- Specified by:
closein interfacehec.io.HecFile- Throws:
IOException- See Also:
-
getAppendedBufferedWriter
- Specified by:
getAppendedBufferedWriterin interfacehec.io.HecFile- Returns:
- See Also:
-
getAppendedDataOutputStream
- Specified by:
getAppendedDataOutputStreamin interfacehec.io.HecFile- Returns:
- See Also:
-
getBufferedReader
- Specified by:
getBufferedReaderin interfacehec.io.HecFile- Returns:
- See Also:
-
getBufferedWriter
- Specified by:
getBufferedWriterin interfacehec.io.HecFile- Returns:
- See Also:
-
getByteArray
public byte[] getByteArray()- Specified by:
getByteArrayin interfacehec.io.HecFile- Returns:
- See Also:
-
getByteArray
public byte[] getByteArray(boolean compress) Return a byte[] containing the data from the File.- Parameters:
compress- flag indicating whether to compress the byte[] being returned
-
getByteArray
public byte[] getByteArray(long off, int len) - Specified by:
getByteArrayin interfacehec.io.HecFile- Parameters:
off-len-- Returns:
- See Also:
-
getByteArrayInputStream
- Specified by:
getByteArrayInputStreamin interfacehec.io.HecFile- Returns:
- See Also:
-
getByteArrayOutputStream
- Specified by:
getByteArrayOutputStreamin interfacehec.io.HecFile- Returns:
- See Also:
-
getCheckSum
public long getCheckSum()- Specified by:
getCheckSumin interfacehec.io.HecFile- Returns:
- See Also:
-
getDataInputStream
- Specified by:
getDataInputStreamin interfacehec.io.HecFile- Returns:
- See Also:
-
getDataOutputStream
- Specified by:
getDataOutputStreamin interfacehec.io.HecFile- Returns:
- See Also:
-
getEndianInputStream
public hec.io.EndianInputStream getEndianInputStream()- Specified by:
getEndianInputStreamin interfacehec.io.HecFile- Returns:
- See Also:
-
getEndianOutputStream
public hec.io.EndianOutputStream getEndianOutputStream()- Specified by:
getEndianOutputStreamin interfacehec.io.HecFile- Returns:
- See Also:
-
getObjectInputStream
- Specified by:
getObjectInputStreamin interfacehec.io.HecFile- Returns:
- See Also:
-
getObjectOutputStream
- Specified by:
getObjectOutputStreamin interfacehec.io.HecFile- Returns:
- Throws:
IOException- See Also:
-
getUsingCompression
public boolean getUsingCompression()- Specified by:
getUsingCompressionin interfacehec.io.HecFile- Returns:
- See Also:
-
isNetworked
public boolean isNetworked()- Specified by:
isNetworkedin interfacehec.io.HecFile- Returns:
- See Also:
-
lockFile
public boolean lockFile(hec.io.FileLock fLock) - Specified by:
lockFilein interfacehec.io.HecFile- Parameters:
fLock-- Returns:
- See Also:
-
notify
- Specified by:
notifyin interfacehec.io.HecFile- Parameters:
message-- See Also:
-
save
public boolean save()- Specified by:
savein interfacehec.io.HecFile- Returns:
- See Also:
-
setByteArray
public boolean setByteArray(byte[] byteArray) - Specified by:
setByteArrayin interfacehec.io.HecFile- Parameters:
byteArray-- Returns:
- See Also:
-
setUseCompression
public void setUseCompression(boolean compress) - Specified by:
setUseCompressionin interfacehec.io.HecFile- Parameters:
compress-- See Also:
-
unlockFile
public boolean unlockFile(hec.io.FileLock fLock) - Specified by:
unlockFilein interfacehec.io.HecFile- Parameters:
fLock-- Returns:
- See Also:
-
writeBytes
public void writeBytes(long bytePos, byte[] bytes) - Specified by:
writeBytesin interfacehec.io.HecFile
-
writeFloat
public void writeFloat(long bytePos, float f) - Specified by:
writeFloatin interfacehec.io.HecFile- Parameters:
bytePos-f-- See Also:
-