Package com.snmp4j.smi
Class NamedInputStream
java.lang.Object
com.snmp4j.smi.NamedInputStream
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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumA supported ZIP file format -
Constructor Summary
ConstructorsConstructorDescriptionNamedInputStream(File file) Creates a NamedInputStream from the specified file.NamedInputStream(InputStream inputStream, String name) Creates a NamedInputStream from anInputStreamand an identifying name.NamedInputStream(InputStream inputStream, String name, NamedInputStream.ZipFormat zipFormat) Creates a NamedInputStream from anInputStreamand an identifying name. -
Method Summary
Modifier and TypeMethodDescriptionGets theInputStream.getName()Gets the name of the input stream.Gets the compression format of the stream.toString()
-
Constructor Details
-
NamedInputStream
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
Creates a NamedInputStream from anInputStreamand an identifying name.- Parameters:
inputStream- theInputStreamreference. It will/should not be closed by users of this NamedInputStream.name- a unique name of the stream (i.e., a file name).
-
NamedInputStream
Creates a NamedInputStream from anInputStreamand an identifying name.- Parameters:
inputStream- theInputStreamreference. 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 theinputStream.
-
-
Method Details
-
getInputStream
Gets theInputStream. Callers should not close it. Closing the stream should be done by the creator of this NamedInputStream.- Returns:
- the input stream.
-
getName
Gets the name of the input stream.- Returns:
- a name for the input stream.
-
getZipFormat
Gets the compression format of the stream. For uncompressed streamsNamedInputStream.ZipFormat.nonewill be returned.- Returns:
- the
NamedInputStream.ZipFormatof this input stream.
-
toString
-