Package ghidra.framework.store.local
Class ItemSerializer
java.lang.Object
ghidra.framework.store.local.ItemSerializer
ItemSerializer
facilitates the compressing and writing of a data stream
to a "packed" file. The resulting "packed" file will contain the following meta-data
which is available after construction:
- Item name
- Content type (int)
- File type (int)
- Data length
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
isPackedFile
(File file) A simple utility method to determine if the given file is a packed file as created by this class.static boolean
isPackedFile
(InputStream inputStream) A convenience method for checking if the file denoted by the given inputStream is a packed file.static void
outputItem
(String itemName, String contentType, int fileType, long length, InputStream content, File packedFile, TaskMonitor monitor) Read and compress data from the specified content stream and write to a packed file along with additional meta-data.
-
Method Details
-
outputItem
public static void outputItem(String itemName, String contentType, int fileType, long length, InputStream content, File packedFile, TaskMonitor monitor) throws CancelledException, IOException Read and compress data from the specified content stream and write to a packed file along with additional meta-data.- Parameters:
itemName
- item namecontentType
- content typefileType
- file typelength
- content length to be readcontent
- content input streampackedFile
- output packed file to be createdmonitor
- task monitor- Throws:
CancelledException
- if output is cancelledIOException
- if IO error occurs
-
isPackedFile
A simple utility method to determine if the given file is a packed file as created by this class.- Parameters:
file
- The file to check- Returns:
- True if it is a packed file
- Throws:
IOException
- If there is a problem reading the given file
-
isPackedFile
A convenience method for checking if the file denoted by the given inputStream is a packed file.Note: This method will NOT close the given inputStream.
- Parameters:
inputStream
- a stream for accessing bytes of what may be a packed file- Returns:
- true if the bytes from the inputStream represent the bytes of a packed file
- Throws:
IOException
- If there is a problem accessing the inputStream- See Also:
-