|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.io.InputStream
java.io.FilterInputStream
org.dicom4j.io.BinaryInputStream
public class BinaryInputStream
Extends FilterInputStream by adding the
concept of little and big endian binary value encoding.
BinaryOutputStream| Constructor Summary | |
|---|---|
BinaryInputStream(InputStream aInput)
Construct a new stream from the supplied stream (byte order: LITTLE_ENDIAN). |
|
BinaryInputStream(InputStream i,
ByteOrder aByteOrder)
Construct a new stream from the supplied stream. |
|
| Method Summary | |
|---|---|
ByteOrder |
getByteOrder()
|
int |
read(byte[] aBytes)
TODO |
String |
readASCII(int aLength)
Read string coded in ACSII |
boolean |
readBoolean()
Reads one byte and returns true if that byte is nonzero, false if that byte is zero. |
byte |
readByte()
Read one byte |
void |
readComplexDouble(double[] freal,
double[] fimaginary,
int len)
Read interleaved complex floating point 64 bit value pairs into real and imaginary arrays. |
void |
readComplexFloat(float[] freal,
float[] fimaginary,
int len)
Read interleaved complex floating point 32 bit value pairs into real and imaginary arrays. |
double |
readDouble()
Read one floating point 64 bit value. |
void |
readDouble(double[] f,
int len)
Read an array of floating point 64 bit values. |
float |
readFloat()
Read one floating point 32 bit value. |
void |
readFloat(float[] f,
int len)
Read an array of floating point 32 bit values. |
void |
readFully(byte[] arg0)
|
void |
readFully(byte[] arg0,
int arg1,
int arg2)
|
void |
readInsistently(byte[] b,
int offset,
int length)
Read as many bytes as requested, unless an exception occurs. |
int |
readSigned16()
Read one signed integer 16 bit value. |
int |
readSigned32()
Read one signed integer 32 bit value. |
String |
readString(int aLength,
String aCharsetName)
read string coded in a specific charset |
int |
readUnsigned16()
Read one unsigned integer 16 bit value. |
void |
readUnsigned16(short[] w,
int len)
Read an array of unsigned integer 16 bit values. |
void |
readUnsigned16(short[] w,
int offset,
int len)
Read an array of unsigned integer 16 bit values. |
long |
readUnsigned32()
Read one unsigned integer 32 bit value. |
int |
readUnsigned8()
Read one unsigned integer 8 bit value. |
int |
readUnsignedByte()
|
int |
readUnsignedShort()
|
void |
setByteOrder(ByteOrder aByteOrder)
|
long |
skip(long aNumberToSkip)
Skips over and discards n bytes of data from the input stream. |
| Methods inherited from class java.io.FilterInputStream |
|---|
available, close, mark, markSupported, read, read, reset |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BinaryInputStream(InputStream aInput)
Construct a new stream from the supplied stream (byte order: LITTLE_ENDIAN).
aInput - the input stream to read from
public BinaryInputStream(InputStream i,
ByteOrder aByteOrder)
Construct a new stream from the supplied stream.
aInput - the input stream to read fromaByteOrder - the byte order| Method Detail |
|---|
public ByteOrder getByteOrder()
public int read(byte[] aBytes)
throws IOException
read in class FilterInputStreamIOException
public String readASCII(int aLength)
throws IOException
aLength - length to read
IOException - if error occurs
public boolean readBoolean()
throws IOException
IOException
public byte readByte()
throws IOException
IOException
public final void readComplexDouble(double[] freal,
double[] fimaginary,
int len)
throws IOException
Read interleaved complex floating point 64 bit value pairs into real and imaginary arrays.
freal - an array of sufficient size in which to return the real values
read, may be null if don't want real valuesfimaginary - an array of sufficient size in which to return the real values
read, may be null if don't want imaginary valueslen - the number of 64 bit values to read
IOException
public final void readComplexFloat(float[] freal,
float[] fimaginary,
int len)
throws IOException
Read interleaved complex floating point 32 bit value pairs into real and imaginary arrays.
freal - an array of sufficient size in which to return the real values
read, may be null if don't want real valuesfimaginary - an array of sufficient size in which to return the real values
read, may be null if don't want imaginary valueslen - the number of 32 bit values to read
IOException
public final double readDouble()
throws IOException
Read one floating point 64 bit value.
IOException
public final void readDouble(double[] f,
int len)
throws IOException
Read an array of floating point 64 bit values.
f - an array of sufficient size in which to return the values readlen - the number of 64 bit values to read
IOException
public final float readFloat()
throws IOException
Read one floating point 32 bit value.
IOException
public final void readFloat(float[] f,
int len)
throws IOException
Read an array of floating point 32 bit values.
f - an array of sufficient size in which to return the values readlen - the number of 32 bit values to read
IOException
public void readFully(byte[] arg0)
throws IOException
IOException
public void readFully(byte[] arg0,
int arg1,
int arg2)
throws IOException
IOException
public void readInsistently(byte[] b,
int offset,
int length)
throws IOException
Read as many bytes as requested, unless an exception occurs.
b - buffer to read intooffset - offset (from 0) in buffer to read intolength - number of bytes to read (no more and no less)
IOException
public final int readSigned16()
throws IOException
Read one signed integer 16 bit value.
IOException
public final int readSigned32()
throws IOException
Read one signed integer 32 bit value.
IOException
public String readString(int aLength,
String aCharsetName)
throws IOException
aLength - length to readaCharsetName - the charset to use
IOException - if error occurs
public final int readUnsigned16()
throws IOException
Read one unsigned integer 16 bit value.
IOException
public final void readUnsigned16(short[] w,
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 readlen - the number of 16 bit values to read
IOException
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 long readUnsigned32()
throws IOException
Read one unsigned integer 32 bit value.
IOException
public final int readUnsigned8()
throws IOException
Read one unsigned integer 8 bit value.
IOException
public int readUnsignedByte()
throws IOException
IOException
public int readUnsignedShort()
throws IOException
IOExceptionpublic void setByteOrder(ByteOrder aByteOrder)
public long skip(long aNumberToSkip)
throws IOException
skip in class FilterInputStreamaNumberToSkip - number of bytes to skip
IOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||