@Test(expected = RuntimeException.class) public void accept() throws IOException { StreamScrap<Integer> ss = new StreamScrap<>(os); assertNotNull(ss.getPrintStream()); ss.close(); ss.accept(new ScrapBin<>(1,this,"TEST", null, ScrapBin.FailureType.GENERAL_FAILURE,null,null)); }
@Override public void accept(ScrapBin<K,Object> bin) { try { os.writeObject(bin.scrap); os.flush(); } catch (IOException e) { throw new RuntimeException("Error streaming scrap object",e); } }
StreamScrap implements ScrapConsumer<K,Object>, Closeable { @Override public void accept(ScrapBin<K,Object> bin) { try { os.writeObject(bin.scrap); os.flush(); } catch (IOException e) { throw new RuntimeException("Error streaming scrap object",e); } } }
StreamScrap implements ScrapConsumer<K,Object>, Closeable { @Override public void accept(ScrapBin<K,Object> bin) { try { os.writeObject(bin.scrap); os.flush(); } catch (IOException e) { throw new RuntimeException("Error streaming scrap object",e); } } StreamScrap(OutputStream os); }
StreamScrap implements ScrapConsumer<K,Object>, Closeable { @Override public void accept(ScrapBin<K,Object> bin) { try { os.writeObject(bin.scrap); os.flush(); } catch (IOException e) { throw new RuntimeException("Error streaming scrap object",e); } } StreamScrap(OutputStream os); @Override void accept(ScrapBin<K,Object> bin); @Override void close(); ObjectOutputStream getPrintStream(); static StreamScrap<K> of(Conveyor<K, ?, ?> conv, OutputStream os); static StreamScrap<K> of(Conveyor<K, ?, ?> conv, File file); static StreamScrap<K> of(Conveyor<K, ?, ?> conv, String file); }
StreamScrap implements ScrapConsumer<K,Object>, Closeable { @Override public void accept(ScrapBin<K,Object> bin) { try { os.writeObject(bin.scrap); os.flush(); } catch (IOException e) { throw new RuntimeException("Error streaming scrap object",e); } } StreamScrap(OutputStream os); @Override void accept(ScrapBin<K,Object> bin); @Override void close(); ObjectOutputStream getPrintStream(); static StreamScrap<K> of(Conveyor<K, ?, ?> conv, OutputStream os); static StreamScrap<K> of(Conveyor<K, ?, ?> conv, File file); static StreamScrap<K> of(Conveyor<K, ?, ?> conv, String file);  }