public class StreamJack extends Object
Constructor and Description |
---|
StreamJack() |
Modifier and Type | Method and Description |
---|---|
static StreamSet |
current()
Returns the currently registered streams.
|
static void |
deregister()
Re-register streams for the current thread, and restore the previous if any.
|
static void |
install()
Install the hijacker.
|
static void |
install(InputStream in,
PrintStream out)
Install the hijacker and register combined streams for the current thread.
|
static void |
install(InputStream in,
PrintStream out,
PrintStream err)
Install the hijacker and register streams for the current thread.
|
static void |
install(StreamSet set)
Install the hijacker and register streams for the current thread.
|
static boolean |
isInstalled()
Check if the hijacker has been installed.
|
static boolean |
isRegistered()
Check if there are streams registered for the current thread.
|
static void |
maybeInstall() |
static void |
maybeInstall(StreamSet set) |
static void |
register(InputStream in,
PrintStream out)
Register combined streams for the current thread.
|
static void |
register(InputStream in,
PrintStream out,
PrintStream err)
Register streams for the current thread.
|
static void |
register(StreamSet set)
Register streams for the current thread.
|
static void |
restore()
Restores the original System streams from
StreamSet.SYSTEM and resets
the hijacker state to un-installed. |
static void |
restore(StreamSet streams)
Restores the System streams to the given pair and resets the hijacker state to un-installed.
|
static void |
uninstall()
Uninstall the hijacker.
|
public static boolean isInstalled()
public static void install()
public static void install(InputStream in, PrintStream out, PrintStream err)
public static void install(InputStream in, PrintStream out)
public static void install(StreamSet set)
public static void maybeInstall()
public static void maybeInstall(StreamSet set)
public static void uninstall()
public static boolean isRegistered()
public static void register(InputStream in, PrintStream out, PrintStream err)
public static void register(InputStream in, PrintStream out)
public static void register(StreamSet set)
public static void deregister()
public static StreamSet current()
public static void restore(StreamSet streams)
public static void restore()
StreamSet.SYSTEM
and resets
the hijacker state to un-installed.Copyright © 2008-2012 Sonatype. All Rights Reserved.