public OutputStreamXMLOutput(@WillCloseWhenClosed Writer writer, String stylesheet) { this.out = writer; this.nestingLevel = 0; this.newLine = true; this.stylesheet = stylesheet; } @Override
public ZipSourceRepository(@WillCloseWhenClosed ZipFile zipFile) { this.zipFile = zipFile; }
/** * Constructor. * * @param writer * Writer to write XML output to */ @SuppressFBWarnings("OBL_UNSATISFIED_OBLIGATION") public OutputStreamXMLOutput(@WillCloseWhenClosed Writer writer) { this(writer, null); } /**
/** * Constructor. * * @param os * OutputStream to write XML output to */ @SuppressFBWarnings("OBL_UNSATISFIED_OBLIGATION") public OutputStreamXMLOutput(@WillCloseWhenClosed OutputStream os) { this(os, null); } /**
public void setBase(@WillCloseWhenClosed SourceRepository base) { this.base = base; ready.countDown(); }
public static Reader reader(@WillCloseWhenClosed InputStream in) { return new InputStreamReader(in, charset); }
public static Reader reader(@WillCloseWhenClosed InputStream in) { return new InputStreamReader(in, charset); }
/** * Constructor. * * @param os * OutputStream to write XML output to * @param stylesheet * name of stylesheet */ public OutputStreamXMLOutput(@WillCloseWhenClosed OutputStream os, String stylesheet) { this.out = new OutputStreamWriter(os, Charset.forName("UTF-8")); this.nestingLevel = 0; this.newLine = true; this.stylesheet = stylesheet; }
public static BufferedReader bufferedReader(@WillCloseWhenClosed InputStream in) { return new BufferedReader(reader(in)); } }
public static Reader getReader(@WillCloseWhenClosed InputStream in) { return UTF8.reader(in); }
public static BufferedReader bufferedReader(@WillCloseWhenClosed InputStream in) { return new BufferedReader(reader(in)); }
public static Writer getWriter(@WillCloseWhenClosed OutputStream out) { return UTF8.writer(out); }
@WillCloseWhenClosed OutputStream oStream = new BufferedOutputStream(new FileOutputStream(outputFile)); if (fileName.endsWith(".gz")) {
/** * Construct a transformed stream. * * @param cur The underlying stream. * @param fun The transformation function. */ public TransformedObjectStream(@WillCloseWhenClosed ObjectStream<S> cur, Function<? super S, ? extends T> fun) { delegate = cur; function = fun; }
/** * Construct a new filtered stream. * @param cur The underlying stream. * @param filt The filter. */ public FilteredObjectStream(@WillCloseWhenClosed ObjectStream<T> cur, Predicate<? super T> filt) { super(); delegate = cur; filter = filt; }
/** * Construct a stream reading lines from a buffered reader. * * @param in The input reader. */ public LineStream(@WillCloseWhenClosed @Nonnull BufferedReader in) { input = in; }
@MustBeClosed static InputStream makeBuffered(@WillCloseWhenClosed InputStream is) { return (is instanceof BufferedInputStream || is instanceof ByteArrayInputStream) ? is : new BufferedInputStream(is); }
/** * Filter an object stream. * * @param <T> The type of object stream rows. * @param stream The source stream. * @param predicate A predicate indicating which rows to return. * @return An object stream returning all rows for which <var>predicate</var> returns * {@code true}. */ public static <T> ObjectStream<T> filter(@WillCloseWhenClosed ObjectStream<T> stream, Predicate<? super T> predicate) { return new FilteredObjectStream<>(stream, predicate); }
@MustBeClosed static OutputStream makeBuffered(@WillCloseWhenClosed OutputStream os) { return (os instanceof BufferedOutputStream || os instanceof ByteArrayOutputStream) ? os : new BufferedOutputStream(os); }
protected GroupingObjectStream(@WillCloseWhenClosed ObjectStream<? extends E> base) { baseStream = base; // prime the stream; nextItem = baseStream.readObject(); }