Package org.apache.qpid.protonj2.client
Class OutputStreamOptions
- java.lang.Object
- 
- org.apache.qpid.protonj2.client.OutputStreamOptions
 
- 
- All Implemented Interfaces:
- Cloneable
 
 public class OutputStreamOptions extends Object implements Cloneable Options class that controls various aspects of aOutputStreaminstance created to write the contents of a section of aStreamSenderMessage.
- 
- 
Field SummaryFields Modifier and Type Field Description static booleanDEFAULT_COMPLETE_SEND_ON_CLOSEDefines the default value for the complete parentStreamSenderMessageon close option
 - 
Constructor SummaryConstructors Constructor Description OutputStreamOptions()Creates aOutputStreamOptionsinstance with default values for all optionsOutputStreamOptions(OutputStreamOptions options)Create aOutputStreamOptionsinstance that copies all configuration from the givenOutputStreamOptionsinstance.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description intbodyLength()OutputStreamOptionsbodyLength(int streamSize)Sets the overall stream size for this associatedOutputStreamthat the options are applied to.OutputStreamOptionsclone()booleancompleteSendOnClose()OutputStreamOptionscompleteSendOnClose(boolean completeContextOnClose)Configures if the close of theOutputStreamshould result in a completion of the parentStreamSenderMessage(default is true).protected OutputStreamOptionscopyInto(OutputStreamOptions other)Copy all options from thisOutputStreamOptionsinstance into the instance provided.
 
- 
- 
- 
Field Detail- 
DEFAULT_COMPLETE_SEND_ON_CLOSEpublic static final boolean DEFAULT_COMPLETE_SEND_ON_CLOSE Defines the default value for the complete parentStreamSenderMessageon close option- See Also:
- Constant Field Values
 
 
- 
 - 
Constructor Detail- 
OutputStreamOptionspublic OutputStreamOptions() Creates aOutputStreamOptionsinstance with default values for all options
 - 
OutputStreamOptionspublic OutputStreamOptions(OutputStreamOptions options) Create aOutputStreamOptionsinstance that copies all configuration from the givenOutputStreamOptionsinstance.- Parameters:
- options- The options instance to copy all configuration values from.
 
 
- 
 - 
Method Detail- 
clonepublic OutputStreamOptions clone() 
 - 
copyIntoprotected OutputStreamOptions copyInto(OutputStreamOptions other) Copy all options from thisOutputStreamOptionsinstance into the instance provided.- Parameters:
- other- the target of this copy operation.
- Returns:
- the OutputStreamOptionsthat was given.
 
 - 
bodyLengthpublic int bodyLength() - Returns:
- the configured stream size limit for associated OutputStream
 
 - 
bodyLengthpublic OutputStreamOptions bodyLength(int streamSize) Sets the overall stream size for this associatedOutputStreamthat the options are applied to.When set this option indicates the number of bytes that can be written to the stream before an error would be thrown indicating that this value was exceeded. Conversely if the stream is closed before the number of bytes indicated is written the send will be aborted and an error will be thrown to the caller. - Parameters:
- streamSize- The fixed number of bytes that must be written in order for the stream to be complete.
- Returns:
- this OutputStreamOptionsinstance.
 
 - 
completeSendOnClosepublic boolean completeSendOnClose() - Returns:
- the whether the close of the OutputStreamshould complete the parentStreamSenderMessage
 
 - 
completeSendOnClosepublic OutputStreamOptions completeSendOnClose(boolean completeContextOnClose) Configures if the close of theOutputStreamshould result in a completion of the parentStreamSenderMessage(default is true). If there is a configured stream size and theOutputStreamis closed the parentStreamSenderMessagewill always be aborted as the send would be incomplete, but the close of anOutputStreammay not always be the desired outcome. In the case the user wishes to add aFooterto the message transmitted by theStreamSenderMessagethis option should be set to false and the user should complete the stream manually.- Parameters:
- completeContextOnClose- Should the- OutputStream.close()method complete the parent- StreamSenderMessage
- Returns:
- this OutputStreamOptionsinstance.
 
 
- 
 
-