public abstract class DicomStream extends java.lang.Object implements IDicomStream
DicomBufferStream.,
@FileStream.| Constructor and Description |
|---|
DicomStream()
Default Constructor for DicomStream.
|
| Modifier and Type | Method and Description |
|---|---|
int |
available()
This method returns the number of bytes available on the stream
|
int |
close()
This method closes the stream.
|
boolean |
endSend()
This method shows the end of sending process.
|
int |
getEndianNess()
Returns the endianNess of the stream [BIG_ENDIAN/LITTLE_ENDIAN]
Endianness defines the byte ordering used to store values as bytes in computer memory.
|
int |
getReadBytes()
Keeps track of how much bytes are read from the stream.
|
int |
getStream()
Returns the stream type to which it is set to [InputStream/outputStream]
|
int |
mark(int iReadAheadLimit)
Marks the current position in this input stream.
|
int |
readBuffer(byte[] arrbyte)
Reads buffer byte per byte from stream.
|
byte |
readByte()
Reads a single byte from the stream.
|
char |
readChar()
Reads a character from the stream.
|
byte[] |
readChars(int iLength)
Reads specified number of characters from the stream.
|
double |
readDouble()
Reads a double from the stream.
|
float |
readFloat()
Reads a float from the stream.
|
int |
readInt()
Reads an integer from the stream.
|
long |
readLong()
Reads a long from stream.
|
short |
readShort()
Reads a short from the stream.
|
java.lang.String |
readString(int iStringLength)
Reads a string from the stream with specified length.
|
byte[] |
readWord()
Reads a word from stream
Note: This method is specifically designed for OW data type of DICOM.
|
int |
reset()
Repositions this stream to the position at the time the mark method was last called on this input stream.
|
int |
setEndianNess(int iEndianNess)
Sets the endianess of the steam [BIG_ENDIAN/LITTLE_ENDIAN]
Endianness defines the byte ordering used to store values as bytes in computer memory.
|
int |
skip(int iNumBytes)
This method skips the specified number of bytes from the current position.
|
boolean |
startReceive()
Shows the beginning of receiving process.
|
boolean |
writeBuffer(byte[] arrByte,
int iOffset,
int iLength)
Writes a sequence of bytes to the stream.
|
int |
writeByte(byte byteVal)
Writes a byte to the stream.
|
int |
writeChar(char charVal)
Writes a character to the stream.
|
int |
writeChars(byte[] arrbyteChar)
Writes the characters on the stream.
|
int |
writeDouble(double dVal)
Writes a double value to the stream.
|
int |
writeFloat(float fVal)
Writes a float value to the stream.
|
int |
writeInt(int iVal)
Writes an int value to the stream.
|
int |
writeLong(int iVal)
Writes a long to the stream.
|
int |
writeShort(short shVal)
Writes a short value on to the stream.
|
int |
writeString(java.lang.String strValue)
Writes a string to the stream.
|
int |
writeWord(byte[] arrbyteVal)
Writes a word to the stream.
|
public int getStream()
getStream in interface IDicomStreampublic int getEndianNess()
getEndianNess in interface IDicomStreampublic int setEndianNess(int iEndianNess)
setEndianNess in interface IDicomStreamiEndianNess - the endianess of the steam [BIG_ENDIAN/LITTLE_ENDIAN]public int getReadBytes()
getReadBytes in interface IDicomStreampublic byte readByte()
throws java.io.IOException
readByte in interface IDicomStreamjava.io.IOException - If IO operation fails or called on DicomStream used as output stream..public char readChar()
throws java.io.IOException
java.io.IOException - If IO operation fails or called on DicomStream used as output stream..public byte[] readChars(int iLength)
throws java.io.IOException
readChars in interface IDicomStreamiLength - number of characters to read.java.io.IOException - If IO operation fails or called on DicomStream used as output stream..public int writeChars(byte[] arrbyteChar)
throws java.io.IOException
writeChars in interface IDicomStreamarrbyteChar - byte array of characters to write.java.io.IOException - If IO operation fails or called on DicomStream used as input stream.public short readShort()
throws java.io.IOException
readShort in interface IDicomStreamjava.io.IOException - If IO operation fails or called on DicomStream used as output stream..public int readInt()
throws java.io.IOException
readInt in interface IDicomStreamjava.io.IOException - If IO operation fails or called on DicomStream used as output stream..public long readLong()
throws java.io.IOException
readLong in interface IDicomStreamjava.io.IOException - If IO operation fails or called on DicomStream used as output stream..public float readFloat()
throws java.io.IOException
readFloat in interface IDicomStreamjava.io.IOException - If IO operation fails or called on DicomStream used as output stream..public double readDouble()
throws java.io.IOException
readDouble in interface IDicomStreamjava.io.IOException - If IO operation fails or called on DicomStream used as output stream..public java.lang.String readString(int iStringLength)
throws java.io.IOException
readString in interface IDicomStreamiStringLength - Length of the string to be read.java.io.IOException - If IO operation fails or called on DicomStream used as output stream..public int writeString(java.lang.String strValue)
throws java.io.IOException
writeString in interface IDicomStreamstrValue - string to be written.java.io.IOException - If IO operation fails or called on DicomStream used as input stream.public int readBuffer(byte[] arrbyte)
throws java.io.IOException
readBuffer in interface IDicomStreamarrbyte - byte array to be populated by stream.java.io.IOException - If IO operation fails or called on DicomStream used as output stream..public byte[] readWord()
throws java.io.IOException
readWord in interface IDicomStreamjava.io.IOException - If IO operation fails or called on DicomStream used as output stream.public int writeWord(byte[] arrbyteVal)
throws java.io.IOException
writeWord in interface IDicomStreamarrbyteVal - byte array of length 2 representing word to be written.java.io.IOException - If IO operation fails or called on DicomStream used as input stream.public int writeByte(byte byteVal)
throws java.io.IOException
writeByte in interface IDicomStreambyteVal - value to be written.java.io.IOException - If IO operation fails or called on DicomStream used as input stream.public int writeChar(char charVal)
throws java.io.IOException
charVal - value to be written.java.io.IOException - If IO operation fails or called on DicomStream used as input stream.public int writeShort(short shVal)
throws java.io.IOException
writeShort in interface IDicomStreamshVal - value to be written.java.io.IOException - If IO operation fails or called on DicomStream used as input stream.public int writeInt(int iVal)
throws java.io.IOException
writeInt in interface IDicomStreamiVal - integer value to write.java.io.IOException - If IO operation fails or called on DicomStream used as input stream.public int writeLong(int iVal)
throws java.io.IOException
writeLong in interface IDicomStreamiVal - Shows long value to write.java.io.IOException - If IO operation fails or called on DicomStream used as input stream.public int writeFloat(float fVal)
throws java.io.IOException
writeFloat in interface IDicomStreamfVal - Shows float value to be written.java.io.IOException - If IO operation fails or called on DicomStream used as input stream.public int writeDouble(double dVal)
throws java.io.IOException
writeDouble in interface IDicomStreamdVal - double value to be written.java.io.IOException - If IO operation fails or called on DicomStream used as input stream.public boolean writeBuffer(byte[] arrByte,
int iOffset,
int iLength)
throws java.io.IOException
writeBuffer in interface IDicomStreamarrByte - byte array contains value to be written.iOffset - the start offset in the data.iLength - the number of bytes to be written.java.io.IOException - If IO operation fails or called on DicomStream used as input stream.public boolean startReceive()
startReceive in interface IDicomStreampublic boolean endSend()
throws java.io.IOException
endSend in interface IDicomStreamjava.io.IOException - Exception if IO operation fails.public int mark(int iReadAheadLimit)
mark in interface IDicomStreamiReadAheadLimit - the maximum limit of bytes that can be read before the mark position becomes invalid.public int reset()
throws java.io.IOException
reset in interface IDicomStreamjava.io.IOException - If IO operation fails or called on DicomStream used as output stream.public int skip(int iNumBytes)
throws java.io.IOException
skip in interface IDicomStreamiNumBytes - number of bytes to be skipped.java.io.IOException - If IO operation fails or called on DicomStream used as output stream.public int available()
throws java.io.IOException
available in interface IDicomStreamjava.io.IOException - If IO operation fails or called on DicomStream used as output stream.public int close()
throws java.io.IOException
close in interface IDicomStreamjava.io.IOException - Exception if IO operation fails.