public class InputSourceDataInputStream
extends java.lang.Object
implements java.io.Closeable
param: dis the underlying Scala InputSourceDataInputStream
Constructor and Description |
---|
InputSourceDataInputStream(byte[] arr)
Create an InputSourceDataInputStream from a byte array
|
InputSourceDataInputStream(java.nio.ByteBuffer bb)
Create an InputSourceDataInputStream from a java.nio.ByteBuffer
|
InputSourceDataInputStream(org.apache.daffodil.io.InputSourceDataInputStream dis) |
InputSourceDataInputStream(java.io.InputStream is)
Create an InputSourceDataInputStream from a java.io.InputStream
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the underlying resource.
|
org.apache.daffodil.io.InputSourceDataInputStream |
dis() |
boolean |
hasData()
Returns true if the input stream has at least 1 bit of data.
|
public InputSourceDataInputStream(org.apache.daffodil.io.InputSourceDataInputStream dis)
public InputSourceDataInputStream(java.io.InputStream is)
is
- (undocumented)public InputSourceDataInputStream(java.nio.ByteBuffer bb)
bb
- (undocumented)public InputSourceDataInputStream(byte[] arr)
arr
- (undocumented)public void close()
This method is used to close the underlying resource associated with the current instance. It is typically used to release any system resources that have been acquired during the lifespan of the instance.
throws IOException if an I/O error occurs during the close operation.
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
public org.apache.daffodil.io.InputSourceDataInputStream dis()
public boolean hasData()
Does not advance the position.
Returns true immediately if the input stream has available data that has not yet been consumed.
On a network input stream, this may block to determine if the stream contains data or is at end-of-data.
This is used when parsing multiple elements from a stream to see if there is data or not before calling parse().
It may also be used after a parse() operation that is intended to consume the entire data stream (such as for a file) to determine if all data has been consumed or some data is left-over.