Package edu.harvard.hul.ois.jhove.module
Class BytestreamModule
- java.lang.Object
-
- edu.harvard.hul.ois.jhove.ModuleBase
-
- edu.harvard.hul.ois.jhove.module.BytestreamModule
-
- All Implemented Interfaces:
Module
public final class BytestreamModule extends ModuleBase
Module for analysis of content as a byte stream. This is the module of last resort, accepting any content as valid and well-formed.
-
-
Field Summary
-
Fields inherited from class edu.harvard.hul.ois.jhove.ModuleBase
_app, _bigEndian, _checksumFinished, _ckSummer, _countStream, _coverage, _crc32, _cstream, _date, _defaultParams, _dstream, _features, _format, _init, _isRandomAccess, _je, _logger, _md5, _mimeType, _name, _nByte, _note, _param, _release, _repInfoNote, _rights, _sha1, _sha256, _signature, _specification, _validityNote, _vendor, _verbosity, _wellFormedNote
-
Fields inherited from interface edu.harvard.hul.ois.jhove.Module
MAXIMUM_VERBOSITY, MINIMUM_VERBOSITY
-
-
Constructor Summary
Constructors Constructor Description BytestreamModule()Creates a BytestreamModule.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcheckSignatures(File file, InputStream stream, RepInfo info)Check signature.intparse(InputStream stream, RepInfo info, int parseIndex)Parse the content of a stream digital object and store the results in RepInfo.-
Methods inherited from class edu.harvard.hul.ois.jhove.ModuleBase
addIntegerProperty, addIntegerProperty, applyDefaultParams, calcRAChecksum, checkSignatures, checksumIfRafNotCopied, getApp, getBase, getBufferedDataStream, getCoverage, getCRC32, getDate, getDefaultParams, getFeatures, getFormat, getMimeType, getName, getNByte, getNote, getRelease, getRepInfoNote, getRights, getSignature, getSpecification, getValidityNote, getVendor, getWellFormedNote, hasFeature, init, initFeatures, initInfo, initParse, isBigEndian, isParamInDefaults, isRandomAccess, param, parse, readByteBuf, readDouble, readDouble, readDouble, readFloat, readFloat, readSignedByte, readSignedByte, readSignedByte, readSignedInt, readSignedInt, readSignedInt, readSignedLong, readSignedRational, readSignedRational, readSignedShort, readSignedShort, readSignedShort, readUnsignedByte, readUnsignedByte, readUnsignedByte, readUnsignedInt, readUnsignedInt, readUnsignedInt, readUnsignedRational, readUnsignedRational, readUnsignedRational, readUnsignedShort, readUnsignedShort, readUnsignedShort, resetParams, setApp, setBase, setChecksums, setCRC32, setDefaultParams, setMD5, setNByte, setSHA1, setSHA256, setupDataStream, setValidityNote, setVerbosity, show, skipBytes, skipBytes, skipDstreamToEnd, vectorToPropArray
-
-
-
-
Method Detail
-
parse
public final int parse(InputStream stream, RepInfo info, int parseIndex) throws IOException
Parse the content of a stream digital object and store the results in RepInfo. Any arbitrary bytestream is considered well-formed.- Specified by:
parsein interfaceModule- Overrides:
parsein classModuleBase- Parameters:
stream- An InputStream, positioned at its beginning, which is generated from the object to be parsed. If multiple calls toparseare made on the basis of a nonzero value being returned, a new InputStream must be provided each time.info- A fresh (on the first call) RepInfo object which will be modified to reflect the results of the parsing If multiple calls toparseare made on the basis of a nonzero value being returned, the same RepInfo object should be passed with each call.parseIndex- Must be 0 in first call toparse. Ifparsereturns a nonzero value, it must be called again withparseIndexequal to that return value.- Throws:
IOException
-
checkSignatures
public void checkSignatures(File file, InputStream stream, RepInfo info)
Check signature. Bytestreams have no signatures, but since any byte stream is considered a valid Bytestream, return immediately doing nothing. The RepInfo._consistent flag will remain true.- Specified by:
checkSignaturesin interfaceModule- Overrides:
checkSignaturesin classModuleBase- Parameters:
file- A File object for the object being parsedstream- An InputStream, positioned at its beginning, which is generated from the object to be parsedinfo- A fresh RepInfo object which will be modified to reflect the results of the test
-
-