Class Streamables
java.lang.Object
com.atlassian.confluence.content.render.xhtml.Streamables
Convenience class for common operations to construct or convert 
Streamable instances.- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic Streamablecombine(Streamable... streamables) Combine a series of streamable instances into a single result.static Streamablecombine(Iterable<Streamable> streamables) Combine a series of streamable instances into a single result.static Streamableempty()Create an empty streamable that will do nothing when itswriteTo()method is called.static Streamablefrom(XmlStreamWriterTemplate template, XmlStreamWriterCallback callback) Create a streamable that will produce the result of executing the provide callback within the template.static StreamableProduce a streamable from a string.static StreamablewithCharacterCounting(Streamable delegate, com.atlassian.fugue.Effect<Long> characterCountCallback) Deprecated.since 7.0.1.static StreamablewithCountingCharacters(Streamable delegate, Consumer<Long> characterCountCallback) Produces a Streamable which counts the number of characters written to another Streamable's writer.static StringwriteToString(Streamable streamable) Write the contents of a streamable to a string.
- 
Constructor Details- 
Streamablespublic Streamables()
 
- 
- 
Method Details- 
fromProduce a streamable from a string. This is the least memory-efficient way to get data into a stream, but may be useful for very simple code.- Parameters:
- source- the string that needs to be streamed
- Returns:
- the streamable version of the provided string
 
- 
combineCombine a series of streamable instances into a single result.- Parameters:
- streamables- the streamables that are to be combined.
- Returns:
- a single streamable that is the equivalent of processing each provided streamable in order
 
- 
combineCombine a series of streamable instances into a single result.- Parameters:
- streamables- the streamables that are to be combined.
- Returns:
- a single streamable that is the equivalent of processing each provided streamable in order
 
- 
fromCreate a streamable that will produce the result of executing the provide callback within the template. Execution of the callback may be postponed until the streamable'swriteTomethod is called.- Parameters:
- template- the template in which to execute the callback
- callback- the callback to execute
- Returns:
- a streamable that will produce the result of executing the callback
 
- 
emptyCreate an empty streamable that will do nothing when itswriteTo()method is called.- Returns:
- an empty streamable
 
- 
writeToStringWrite the contents of a streamable to a string. For efficiency, this should be done as little and as late as possible in the rendering pipeline.- Parameters:
- streamable- the streamable to write
- Returns:
- a string containing the contents of the streamable.
 
- 
withCharacterCounting@Deprecated public static Streamable withCharacterCounting(Streamable delegate, com.atlassian.fugue.Effect<Long> characterCountCallback) Deprecated.since 7.0.1. UsewithCountingCharacters(Streamable, Consumer)Produces a Streamable which counts the number of characters written to another Streamable's writer.- Parameters:
- delegate- The streamable to be wrapped
- characterCountCallback- The callback for receiving the character count
- Returns:
- A Streamable wrapper
- Since:
- 5.8
 
- 
withCountingCharacterspublic static Streamable withCountingCharacters(Streamable delegate, Consumer<Long> characterCountCallback) Produces a Streamable which counts the number of characters written to another Streamable's writer.- Parameters:
- delegate- The streamable to be wrapped
- characterCountCallback- The callback for receiving the character count
- Returns:
- A Streamable wrapper
- Since:
- 7.0.1
 
 
-