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.
  • Constructor Details

    • BytestreamModule

      public BytestreamModule()
      Creates a BytestreamModule.
  • Method Details

    • 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:
      parse in interface Module
      Overrides:
      parse in class ModuleBase
      Parameters:
      stream - An InputStream, positioned at its beginning, which is generated from the object to be parsed. If multiple calls to parse are 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 to parse are 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 to parse. If parse returns a nonzero value, it must be called again with parseIndex equal 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:
      checkSignatures in interface Module
      Overrides:
      checkSignatures in class ModuleBase
      Parameters:
      file - A File object for the object being parsed
      stream - An InputStream, positioned at its beginning, which is generated from the object to be parsed
      info - A fresh RepInfo object which will be modified to reflect the results of the test