com.ibm.rational.test.lt.testgen.core.store

Class ConvertedAttachmentOutputStream

  • All Implemented Interfaces:
    Closeable, Flushable


    public class ConvertedAttachmentOutputStream
    extends OutputStream
    An output stream returned by an 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 Detail

      • ConvertedAttachmentOutputStream

        public ConvertedAttachmentOutputStream(com.ibm.rational.test.lt.testgen.core.internal.store.TemporaryAttachment attachment)
    • Method Detail

      • write

        public void write(IPacketAttachment attachment)
                   throws IOException
        Writes the content of an attachment to the receiver. The original content is referenced rather than copied, so this method is much more efficient than a loop reading bytes from the original attachment and writing them to the receiver.
        Parameters:
        attachment - A packet attachment.
        Throws:
        IOException - Any exception thrown by the I/O layer.
      • write

        public void write(IPacketAttachment attachment,
                 InputStream inputStream)
                   throws IOException
        Writes the content of an input stream, starting at the stream current position, till the end of stream is reached.
        Parameters:
        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.
        Throws:
        IOException - Any exception thrown by the I/O layer.
IBM Rational Performance Tester SDK

© Copyright IBM Corp. 2013. All rights reserved.