|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.io.InputStream
org.dicom4j.io.EncapsulatedInputStream
public class EncapsulatedInputStream
A class that extends InputStream by adding
a mechanism for unecapsulating an undefined length DICOM attribute, such as is used for
compressed Pixel Data.
The read methods hide the fact that the data is encapsulated by removing the Items and Item and Sequence delimiter tags, as well as skipping any Basic Offset Table that may be present in the first Item.
A nextFrame() method is provided to skip any padding at the end of
a fragment, if any, and position the stream at the begin of the next fragment, since frame
data is not permitted to span fragments, but an individual frame may be fragmented.
| Constructor Summary | |
|---|---|
EncapsulatedInputStream(BinaryInputStream i)
Construct a byte ordered stream from the supplied stream. |
|
| Method Summary | |
|---|---|
void |
nextFrame()
Skip to the start of a fragment, if not already there. |
int |
read()
Extracts the next byte of data from the current or subsequent fragments. |
int |
read(byte[] b)
Extracts byte.length bytes of data from the current or
subsequent fragments. |
int |
read(byte[] b,
int off,
int len)
Extracts len bytes of data from the current or
subsequent fragments. |
void |
readUnsigned16(short[] w,
int offset,
int len)
Read an array of unsigned integer 16 bit values. |
| Methods inherited from class java.io.InputStream |
|---|
available, close, mark, markSupported, reset, skip |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public EncapsulatedInputStream(BinaryInputStream i)
Construct a byte ordered stream from the supplied stream.
The byte order may be changed later.
i - the input stream to read from| Method Detail |
|---|
public void nextFrame()
Skip to the start of a fragment, if not already there.
public final void readUnsigned16(short[] w,
int offset,
int len)
throws IOException
Read an array of unsigned integer 16 bit values.
w - an array of sufficient size in which to return the values readoffset - the offset in the array at which to begin storing valueslen - the number of 16 bit values to read
IOException
public final int read()
throws IOException
Extracts the next byte of data from the current or subsequent fragments.
read in class InputStreamIOException - if an I/O error occurs.
public final int read(byte[] b)
throws IOException
Extracts byte.length bytes of data from the current or
subsequent fragments.
This method simply performs the call read(b, 0, b.length) and returns
the result.
read in class InputStreamb - the buffer into which the data is read.
IOException - if an I/O error occurs.read(byte[], int, int)
public final int read(byte[] b,
int off,
int len)
throws IOException
Extracts len bytes of data from the current or
subsequent fragments.
read in class InputStreamb - the buffer into which the data is read.off - the start offset of the data.len - the number of bytes read.
IOException - if an I/O error occurs.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||