@Restricted(value=org.kohsuke.accmod.restrictions.NoExternalUse.class) public class OutputStreamSelector extends OutputStream implements WrapperOutputStream
Constructor and Description |
---|
OutputStreamSelector(Supplier<OutputStream> binaryOutputStreamProvider,
Supplier<OutputStream> textOutputStreamProvider)
Constructs an OutputStreamSelector using the provided streams.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
flush() |
void |
reset()
Resets the state of this stream to allow for contents to be probed again.
|
OutputStream |
unwrap()
Unwraps this stream, potentially forcing unwritten data to be flushed.
|
void |
write(byte[] b,
int off,
int len) |
void |
write(int b) |
write
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
unwrapRecursively
public OutputStreamSelector(@NonNull Supplier<OutputStream> binaryOutputStreamProvider, @NonNull Supplier<OutputStream> textOutputStreamProvider)
binaryOutputStreamProvider
- a provider of an OutputStream to use if the contents written appear to be binarytextOutputStreamProvider
- a provider of an OutputStream to use if the contents written appear to be textualpublic void write(int b) throws IOException
write
in class OutputStream
IOException
public void write(@NonNull byte[] b, int off, int len) throws IOException
write
in class OutputStream
IOException
public void flush() throws IOException
flush
in interface Flushable
flush
in class OutputStream
IOException
public void reset()
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class OutputStream
IOException
@NonNull public OutputStream unwrap() throws IOException
WrapperOutputStream
unwrap
in interface WrapperOutputStream
IOException
- if an exception occurs preparing the unwrapped referenceCopyright © 2016–2022. All rights reserved.