|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.entityfs.util.io.InputStreamToDataSourceAdapter
public class InputStreamToDataSourceAdapter
This adapter is used to adapt an InputStream to the
DataSource interface.
OutputStreamToDataSinkAdapter,
DataSourceToInputStreamAdapter| Constructor Summary | |
|---|---|
InputStreamToDataSourceAdapter(InputStream in)
|
|
| Method Summary | |
|---|---|
int |
available()
Returns an estimate of the number of bytes that can be read from this data source without blocking by the next invocation of a method for this data source. |
void |
close()
Close the source and free all resources associated with it. |
protected void |
finalize()
|
int |
read()
Read a byte of data from the source. |
int |
read(byte[] barr)
Read up to b.length bytes of data from the source into the array. |
int |
read(byte[] barr,
int off,
int len)
Read up to len bytes of data from the source into the array. |
long |
skipBytes(long n)
Attempt to skip over n bytes in the source. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public InputStreamToDataSourceAdapter(InputStream in)
| Method Detail |
|---|
public void close()
throws WrappedIOException
DataSource
close in interface DataSourceWrappedIOException - On I/O errors.
public int read()
throws IllegalStateException,
WrappedIOException
DataSource0x00-0x0ff).
read in interface DataSource-1 if the end of the source has
been reached.
IllegalStateException - If the source is closed.
WrappedIOException - On I/O errors.
public int read(byte[] barr)
throws IllegalStateException,
WrappedIOException
DataSourceb.length bytes of data from the source into the array.
read in interface DataSourcebarr - The byte array into which data is read.
-1 if
no data could be read because the the end of the source was reached
before the read started.
IllegalStateException - If the source is closed.
WrappedIOException - On I/O errors.
public int read(byte[] barr,
int off,
int len)
throws IllegalStateException,
WrappedIOException
DataSourcelen bytes of data from the source into the array.
read in interface DataSourcebarr - The byte array into which data is read.off - The start offset in the array b at which data is
written.len - The maximum number of bytes to read.
-1 if
no data could be read because the end of the source was reached before
the read started.
IllegalStateException - If the source is closed.
WrappedIOException - On I/O errors.
public long skipBytes(long n)
throws IllegalStateException,
WrappedIOException
DataSourcen bytes in the source. If n is
negative, no bytes are skipped.
The pointer in the source cannot be moved beyond EOF using this method
(unlike RandomAccess.seek(long)).
skipBytes in interface DataSourcen - The number of bytes to increment the source pointer with.
IllegalStateException - If the source is closed.
WrappedIOExceptionRandomAccess.seek(long)
public int available()
throws IllegalStateException,
WrappedIOException
DataSource
available in interface DataSourceIllegalStateException - If the source is closed.
WrappedIOException - On I/O errors.InputStream.available()
protected void finalize()
throws Throwable
finalize in class ObjectThrowable
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||