# Interface: com.pnfsoftware.jeb.core.input.IInput

Standard input interface for units. 

 Note: Since users of [IInput](IInput) are responsible for closing generated [streams](#getStream()) and [channels](#getChannel()), the implementation of [#close()](#close()) is optional, and client code may call it \(optionally\) as a safety mechanism.

## Static Field: IDEAL_HEADER_SIZE
Type: `int`

Constant value: `512`
Description: Recommended number of bytes to expose via [#getHeader()](#getHeader()).

## Method: canRead
- return type: `boolean`

Description: Determine whether this input is readable.
return: `true` if the input can currently be read

## Method: close

Description: Close that input and free all resources used by this object.

## Method: getChannel
- return type: `java.nio.channels.SeekableByteChannel`

Description: Get a seekable read\-only channel representing the input. Each call returns a unique channel. Clients should use this method to efficiently read at various locations within the given input.
return: a unique seekable channel
throws: on IO error

## Method: getCurrentSize
- return type: `long`

Description: Provide the current input size of the input data.
return: the size, \-1 if the size cannot be calculated or if an error occurred

## Method: getHeader
- return type: `java.nio.ByteBuffer`

Description: Get a read\-only, big\-endian buffer of the first input bytes. Clients should not attempt to modify or directly access that buffer. The initial position is set to 0. It is recommended that implementations provide at least [#IDEAL_HEADER_SIZE](#IDEAL_HEADER_SIZE) bytes.
return: a unique buffer; on error, the returned buffer is null \(unlike other methods declared         in this interface, this method does not throw [IOException](IOException)\)

## Method: getName
- return type: `java.lang.String`

Description: Retrieve the optional input name.
return: the input name, or `null` if unnamed

## Method: getStream
- return type: `java.io.InputStream`

Description: Get the input stream. Each call returns a unique stream. Implementors should offer this method for convenience. The implementor is responsible for closing non\-closed streams when [#close()](#close()) is called.
return: a unique input stream
throws: on IO error

## Method: toOutputFile
- parameter: `outputFile`, type: `java.io.File`

Description: Dump the input stream to the provided file.
parameter: outputFile: destination file
throws: on IO error

