# Interface: com.pnfsoftware.jeb.core.input.IInput

Standard input interface for units.  

  Note: Since users of [IInput](com.pnfsoftware.jeb.core.input.IInput.md) 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 Final Field: IDEAL_HEADER_SIZE
Type: `int`

Constant value: `512`
Description: Recommended number of bytes to expose via [#getHeader()](#getHeader()).

## Abstract Method: canRead
- return type: `boolean`

Description: Determine whether this input is readable.
return: `true` if the input can currently be read

## Abstract Method: close

Description: Close that input and free all resources used by this object.

## Abstract Method: getChannel
- return type: `java.nio.channels.SeekableByteChannel`
- throws: `java.io.IOException`

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

## Abstract 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

## Abstract 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](java.io.IOException)\)

## Abstract Method: getName
- return type: `java.lang.String`

Description: Retrieve the optional input name.
return: the input name, or `null` if unnamed

## Abstract Method: getStream
- return type: `java.io.InputStream`
- throws: `java.io.IOException`

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

## Default Method: toOutputFile
- parameter: `outputFile`, type: `java.io.File`
- throws: `java.io.IOException`

Description: Dump the input stream to the provided file.
parameter: outputFile: destination file
throws: on IO error

