public class TagSearchingOutputStream extends FilterOutputStream
OutputStream that searches for a specific tag in the data stream
and when found it calls back.| Modifier and Type | Class and Description |
|---|---|
static interface |
TagSearchingOutputStream.Callback
The mechanism to let the client know that the tag has been found.
|
| Constructor and Description |
|---|
TagSearchingOutputStream(OutputStream out,
byte[] tag,
TagSearchingOutputStream.Callback callback)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
int |
outputTag()
Queries whether the tag being searched for is output or not and if so if it is before or
after the call to
TagSearchingOutputStream.Callback.tagFound(TagSearchingOutputStream). |
int |
outputTag(int tagOutput)
Sets whether the tag being searched for is output or not and if so if it is before or
after the call to
TagSearchingOutputStream.Callback.tagFound(TagSearchingOutputStream). |
boolean |
searchForTag()
Query whether the tag searching is turned on or off.
|
boolean |
searchForTag(boolean search)
Turn on or off the tag searching.
|
void |
write(int b) |
flush, write, writepublic TagSearchingOutputStream(OutputStream out, byte[] tag, TagSearchingOutputStream.Callback callback) throws IOException
IOExceptionpublic boolean searchForTag(boolean search)
throws IOException
TagSearchingOutputStream.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.search - true if tag should be searched for; false otherwiseIOExceptionpublic boolean searchForTag()
throws IOException
true if tag searching is on; false otherwiseIOExceptionpublic int outputTag(int tagOutput)
throws IOException
TagSearchingOutputStream.Callback.tagFound(TagSearchingOutputStream). By default
the tag being searched for will not be output.tagOutput - 0 if 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 callbackIOExceptionpublic int outputTag()
throws IOException
TagSearchingOutputStream.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 callback0 if 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 callbackIOExceptionpublic void write(int b)
throws IOException
write in class FilterOutputStreamIOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class FilterOutputStreamIOExceptionCopyright © 2010 - 2020 Adobe. All Rights Reserved