|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.io.OutputStream
com.pixelmed.network.AssociationOutputStream
public class AssociationOutputStream
A specialized java.io.OutputStream which buffers and fragments
data which is written to it into PDUs and sends them over
the supplied OutputStream which is (presumably) that of the java.net.Socket
of an established Association.
This stream buffers data that is written to it and when it is either flushed or closed or reaches the specified maximum PDU size, writes data (not command) PDU's to the supplied output stream.
Need to take care with "last fragment" flag ... that cannot be set until close() is called, and if the buffer is empty at that time, a zero length PDU will be sent.
| Constructor Summary | |
|---|---|
AssociationOutputStream(OutputStream out,
int maxPDUSize,
int presentationContextID,
int debugLevel)
Construct a PDU buffering OutputStream on top of another OutputStream |
|
| Method Summary | |
|---|---|
void |
close()
Sets the last fragment flag and flushes (which sends a zero length PDU if necessary, and pads to an even length, if necessary). |
void |
flush()
Do nothing. |
void |
write(byte[] b)
Buffer the supplied data, flushing (actually sending) PDUs when the buffer is filled. |
void |
write(byte[] b,
int off,
int len)
Buffer the supplied data, flushing (actually sending) PDUs when the buffer is filled. |
void |
write(int i)
Buffer the supplied data, flushing (actually sending) PDUs when the buffer is filled. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AssociationOutputStream(OutputStream out,
int maxPDUSize,
int presentationContextID,
int debugLevel)
throws DicomNetworkException
out - where to send the buffered outputmaxPDUSize - how large to make the buffer (i.e. the PDU) sizepresentationContextID - included in the header of each PDUdebugLevel - 0 for no debugging, > 0 for increasingly verbose debugging
DicomNetworkException| Method Detail |
|---|
public void write(int i)
throws IOException
write in class OutputStreami -
IOException
public void write(byte[] b)
throws IOException
write in class OutputStreamb -
IOException
public void write(byte[] b,
int off,
int len)
throws IOException
write in class OutputStreamb - off - len -
IOException
public void close()
throws IOException
close in interface Closeableclose in class OutputStreamIOException
public void flush()
throws IOException
flush in interface Flushableflush in class OutputStreamIOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||