public class ConvertedAttachmentOutputStream extends OutputStream
IConvertedPacketAttachment
. Besides output stream
regular features, this output stream allows the caller to write a complete or a part
of an existing attachment. These additional write methods are more efficient than
a byte-to-byte copy between two streams.Constructor and Description |
---|
ConvertedAttachmentOutputStream(com.ibm.rational.test.lt.testgen.core.internal.store.TemporaryAttachment attachment) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
write(byte[] b) |
void |
write(byte[] b,
int off,
int len) |
void |
write(int b) |
void |
write(IPacketAttachment attachment)
Writes the content of an attachment to the receiver.
|
void |
write(IPacketAttachment attachment,
InputStream inputStream)
Writes the content of an input stream, starting at the stream current position, till
the end of stream is reached.
|
flush
public ConvertedAttachmentOutputStream(com.ibm.rational.test.lt.testgen.core.internal.store.TemporaryAttachment attachment)
public void write(int b) throws IOException
write
in class OutputStream
IOException
public void write(byte[] b, int off, int len) throws IOException
write
in class OutputStream
IOException
public void write(byte[] b) throws IOException
write
in class OutputStream
IOException
public void write(IPacketAttachment attachment) throws IOException
attachment
- A packet attachment.IOException
- Any exception thrown by the I/O layer.public void write(IPacketAttachment attachment, InputStream inputStream) throws IOException
attachment
- If applicable, the attachment that the input stream was created from.
If this argument is null
, the stream will be copied. If this argument is non
null, it must be the attachment that was used to create inputStream
; in this
case, the attachment content will be referenced rather than copied.inputStream
- An input stream. The remaining data in the input stream will be
read and written to the receiver.IOException
- Any exception thrown by the I/O layer.public void close() throws IOException
close
in interface Closeable
close
in class OutputStream
IOException
© Copyright IBM Corp. 2013. All rights reserved.