List of usage examples for java.io PipedOutputStream write
public void write(int b) throws IOException
byte
to the piped output stream. From source file:ubicrypt.core.Utils.java
public static InputStream convert(final Observable<byte[]> source) { final PipedOutputStream pos = new PipedOutputStream(); try {//from w w w. j ava 2 s. c o m final PipedInputStream pis = new PipedInputStream(pos); source.subscribe(bytes -> { try { pos.write(bytes); pos.flush(); } catch (final IOException e) { Throwables.propagate(e); } }, err -> { log.error(err.getMessage(), err); try { pis.close(); } catch (final IOException e) { } }); return pis; } catch (final IOException e) { Throwables.propagate(e); } return null; }