Package com.adobe.internal.io
Class TagSearchingOutputStream
java.lang.Object
java.io.OutputStream
java.io.FilterOutputStream
com.adobe.internal.io.TagSearchingOutputStream
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable
An
OutputStream that searches for a specific tag in the data stream
and when found it calls back.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceThe mechanism to let the client know that the tag has been found. -
Constructor Summary
ConstructorsConstructorDescriptionTagSearchingOutputStream(OutputStream out, byte[] tag, TagSearchingOutputStream.Callback callback) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()intQueries whether the tag being searched for is output or not and if so if it is before or after the call toTagSearchingOutputStream.Callback.tagFound(TagSearchingOutputStream).intoutputTag(int tagOutput) Sets whether the tag being searched for is output or not and if so if it is before or after the call toTagSearchingOutputStream.Callback.tagFound(TagSearchingOutputStream).booleanQuery whether the tag searching is turned on or off.booleansearchForTag(boolean search) Turn on or off the tag searching.voidwrite(int b) Methods inherited from class java.io.FilterOutputStream
flush, write, writeMethods inherited from class java.io.OutputStream
nullOutputStream
-
Constructor Details
-
TagSearchingOutputStream
public TagSearchingOutputStream(OutputStream out, byte[] tag, TagSearchingOutputStream.Callback callback) throws IOException Constructor.- Throws:
IOException
-
-
Method Details
-
searchForTag
Turn on or off the tag searching. This must not be called during theTagSearchingOutputStream.Callback.tagFound(TagSearchingOutputStream). If tag searching should be turned off after the return from the callback then the client can use the return value from the callback method to turn searching off.- Parameters:
search-trueif tag should be searched for;falseotherwise- Returns:
- the tag search state before the call
- Throws:
IOException
-
searchForTag
Query whether the tag searching is turned on or off.- Returns:
- the current tag search state
trueif tag searching is on;falseotherwise - Throws:
IOException
-
outputTag
Sets whether the tag being searched for is output or not and if so if it is before or after the call toTagSearchingOutputStream.Callback.tagFound(TagSearchingOutputStream). By default the tag being searched for will not be output.- Parameters:
tagOutput-0if tag should not be output;-1(or any -ve number) if the tag should be output before the callback;1(or any +ve number) if the tag should be output after the callback- Returns:
- the tag output state before the call
- Throws:
IOException
-
outputTag
Queries whether the tag being searched for is output or not and if so if it is before or after the call toTagSearchingOutputStream.Callback.tagFound(TagSearchingOutputStream). By default the tag being searched for will not be output.-1(or any -ve number) if the tag should be output before the callback;1(or any +ve number) if thte tag should be output after the callback- Returns:
- the current tag output state
0if tag should not be output;-1(or any -ve number) if the tag should be output before the callback;1(or any +ve number) if the tag should be output after the callback - Throws:
IOException
-
write
- Overrides:
writein classFilterOutputStream- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classFilterOutputStream- Throws:
IOException
-