Package com.illumon.dbtypes
Interface DbFile
- All Known Subinterfaces:
DbImage
- All Known Implementing Classes:
DbFileImpl,DbImageImpl
public interface DbFile
An opaque array of bytes, intended to represent the contents of a file.
-
Method Summary
Modifier and TypeMethodDescriptionbyte[]getBytes()Gets the file content as a byte array.getName()Gets the file name.getType()Gets the file type.static DbFileCreates an empty file.static DbFilenewInstance(byte[] bytes) Creates a file from file bytes.static DbFilenewInstance(File file) Creates a file from a file on the filesystem.static DbFilenewInstance(String file) Creates a file from a file on the filesystem.voidWrites the file out.
-
Method Details
-
getName
String getName()Gets the file name.- Returns:
- file name.
-
getType
String getType()Gets the file type.- Returns:
- file type.
-
getBytes
byte[] getBytes()Gets the file content as a byte array.- Returns:
- file content as a byte array.
-
write
Writes the file out.- Parameters:
file- output file name- Throws:
IOException- problem writing out the file.
-
newInstance
Creates an empty file. -
newInstance
Creates a file from file bytes.- Parameters:
bytes- file bytes- Throws:
NullPointerException- if bytes is null.
-
newInstance
Creates a file from a file on the filesystem.- Parameters:
file- file location- Throws:
NullPointerException- file is null.
-
newInstance
Creates a file from a file on the filesystem.- Parameters:
file- file location- Throws:
NullPointerException- file is null.
-