public class AssociationIO
extends java.lang.Object
Maximum PDU length: Normally the maximum pdu length of PDATA_TF pdu's
in which DIMSE messages are fragmented and encapsulated as they are sent to
the peer device, is taken from the
length specified by the peer device in the received Request or Acknowledge
message. This length can be changed with the
setMaxPduLength(int length)
method.
It is the caller's responsability to ensure that the maximum length
specified is not greater than the maximum length specified by the peer device.
Note: This class replaces the Association class and is the preferred way for exchanging messages on an assocation.
Constructor and Description |
---|
AssociationIO(java.io.InputStream in,
java.io.OutputStream out)
Constructs a new AssocationIO object from the combination of an inputstream
and an outputstream.
|
Modifier and Type | Method and Description |
---|---|
void |
addProgressListener(AssociationIOProgressListener progressListener) |
int |
getMaxPduLength()
returns the maximum pdu length used in writing dimse messages as specified
by setMaxPduLength or -1 if this property is not set explicitly.
|
boolean |
isSeparateDataPDU()
See setSeparateDataPDU
|
boolean |
isWriteGroupLengths()
see setWriteGroupLengths
|
boolean |
isWriteSeqUndefLength()
see setWriteSeqUndefLength
|
ULServiceMessage |
read()
reads an ULServiceMessage from an association.
|
void |
removeProgressListener(AssociationIOProgressListener progressListener) |
void |
setMaxPduLength(int length)
sets the maximum pdu length to use for writing PDATA_TF pdu's.
|
void |
setSeparateDataPDU(boolean separateDataPDU)
sets whether or not datasets of dimse messages are (partly) sent in the
PDATA_TF pdu that contained the command part of the dimse message.
|
void |
setWriteGroupLengths(boolean groupLengths)
specifies if group lengths should be generated when writing the dataset to
the network.
|
void |
setWriteSeqUndefLength(boolean sequndeflen)
Sets wether or not sequences of datasets are written with undefined
or defined length.
|
void |
write(ULServiceMessage ulServiceMessage)
writes an ULServiceMessage on to the outputstream of an assocation.
|
public AssociationIO(java.io.InputStream in, java.io.OutputStream out)
in
- the inputstream to read messages fromout
- the outputstream to write messages topublic ULServiceMessage read() throws java.io.IOException, PduException, AbortException, DicomException
java.io.IOException
- -PduException
- -AbortException
- -DicomException
- -public void write(ULServiceMessage ulServiceMessage) throws java.io.IOException, PduException, DicomException
ulServiceMessage
- the message to be writtenjava.io.IOException
- -PduException
- -DicomException
- -public boolean isSeparateDataPDU()
public void setSeparateDataPDU(boolean separateDataPDU)
separateDataPDU
- true or falsepublic boolean isWriteSeqUndefLength()
public void setWriteSeqUndefLength(boolean sequndeflen)
sequndeflen
- true or falsepublic int getMaxPduLength()
public void setMaxPduLength(int length)
length
- max pdu lengthpublic void addProgressListener(AssociationIOProgressListener progressListener)
public void removeProgressListener(AssociationIOProgressListener progressListener)
public boolean isWriteGroupLengths()
public void setWriteGroupLengths(boolean groupLengths)
groupLengths
- true or false