/** * Create a new storage area with the given stub. * @param stub */ public OutputStreamStorage( OutputStreamStub stub ) { if( stub.getOutputFile() != null ) { this.file = stub.getOutputFile(); this.outputStream = initializeOutputStream(stub.getOutputFile()); } else if( stub.getOutputStream() != null ) { this.file = null; this.outputStream = stub.getOutputStream(); } else throw new ReviewedGATKException("Not enough information to create storage for an OutputStream; need either a file or an existing output stream"); }
private static boolean outputIsStdout(final Object out) { if ( out == null ) { return false; } else if ( out instanceof SAMFileWriterStub ) { return ((SAMFileWriterStub)out).getOutputStream() != System.out; } else if ( out instanceof VariantContextWriterStub ) { return ((VariantContextWriterStub)out).getOutputStream() == System.out; } else if ( out instanceof OutputStreamStub ) { return ((OutputStreamStub)out).getOutputStream() == System.out; } return false; }