Class NamedInputStream

java.lang.Object
com.snmp4j.smi.NamedInputStream

public class NamedInputStream extends Object
The NamedInputStream class represents an input stream with a name to identify the stream. SmiManager uses NamedInputStreams when compiling MIB specifications into its internal MIB repository cache.

The InputStream returned by getInputStream() must be closed after the SmiManager.compile(NamedInputStream) or SmiManager.compile(NamedInputStream[], CompilationMonitor, boolean, boolean, boolean) methods have been called.

Author:
Frank Fock
  • Constructor Details

    • NamedInputStream

      public NamedInputStream(File file) throws FileNotFoundException
      Creates a NamedInputStream from the specified file.
      Parameters:
      file - the file to create a named input stream for.
      Throws:
      FileNotFoundException - if the file cannot be found.
    • NamedInputStream

      public NamedInputStream(InputStream inputStream, String name)
      Creates a NamedInputStream from an InputStream and an identifying name.
      Parameters:
      inputStream - the InputStream reference. It will/should not be closed by users of this NamedInputStream.
      name - a unique name of the stream (i.e., a file name).
    • NamedInputStream

      public NamedInputStream(InputStream inputStream, String name, NamedInputStream.ZipFormat zipFormat)
      Creates a NamedInputStream from an InputStream and an identifying name.
      Parameters:
      inputStream - the InputStream reference. It will/should not be closed by users of this NamedInputStream.
      name - a unique name of the stream (i.e., a file name).
      zipFormat - the compression and archive format of the inputStream.
  • Method Details