use of com.google.common.io.NullOutputStream in project conceal by facebook.
the class CipherWriteBenchmark method setUp.
@Override
public void setUp() throws Exception {
Random random = new Random();
mData = new byte[size];
random.nextBytes(mData);
mNullOutputStream = new NullOutputStream();
mHMAC = HMAC.getInstance();
mNativeGCMCipherHelper = NativeGCMCipherHelper.getInstance();
mAESCipher = AESCipher.getInstance();
Security.addProvider(new BouncyCastleProvider());
mBCGCMCipher = BouncyCastleGCMCipher.getInstance();
}
use of com.google.common.io.NullOutputStream in project cdap by caskdata.
the class ConfigurationJsonTool method main.
public static void main(String[] args) {
String programName = System.getProperty("script", "ConfigurationJsonTool");
Set<String> validArgument = Sets.newHashSet();
validArgument.add(CDAP_CONFIG);
validArgument.add(SECURITY_CONFIG);
if (args.length != 1 || !(validArgument.contains(args[0]))) {
System.err.println(String.format("Usage: %s (%s | %s)", programName, CDAP_CONFIG, SECURITY_CONFIG));
System.exit(1);
}
PrintStream stdout = System.out;
// Redirect the stdout to null to suppress any log outputs generated during the json generation
System.setOut(new PrintStream(new NullOutputStream()));
StringBuilder output = new StringBuilder();
exportToJson(args[0], output);
// Restore the stdout
System.setOut(stdout);
System.out.print(output);
}
Aggregations