Package com.pnfsoftware.jeb.core.input
Interface IInput
- All Known Implementing Classes:
BytesInput
,FileInput
,LazyInput
,SubInput
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
canRead()
Determine whether this input is readable.void
close()
Close that input and free all resources used by this object.Get a seekable read-only channel representing the input.long
Provide the current input size of the input data.Get a read-only, big-endian buffer of the first input bytes.getName()
Retrieve the optional input name.Get the input stream.
-
Field Details
-
IDEAL_HEADER_SIZE
static final int IDEAL_HEADER_SIZE- See Also:
-
-
Method Details
-
getName
String getName()Retrieve the optional input name.- Returns:
-
canRead
boolean canRead()Determine whether this input is readable.- Returns:
-
close
void close()Close that input and free all resources used by this object. -
getCurrentSize
long getCurrentSize()Provide the current input size of the input data.- Returns:
- the size, -1 if the size cannot be calculated or if an error occurred
-
getHeader
ByteBuffer getHeader()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 leastIDEAL_HEADER_SIZE
bytes.- Returns:
- a unique buffer; on error, the returned buffer is null (unlike other methods declared
in this interface, this method does not throw
IOException
)
-
getChannel
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.- Returns:
- a unique seekable channel
- Throws:
IOException
- on IO error
-
getStream
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 whenclose()
is called.- Returns:
- a unique input stream
- Throws:
IOException
- on IO error
-