Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

15
LINES

< > BotCompany Repo | #1017324 // teeOutputStream - splitting OutputStream

JavaX fragment (include)

static OutputStream teeOutputStream(final OutputStream a, final OutputStream b) {
  if (a == null) ret b;
  if (b == null) ret a;
  ret new OutputStream {
    public void write(int byt) throws IOException {
      a.write(byt);
      b.write(byt);
    }
    
    public void write(byte[] byt, int off, int len) throws IOException {
      a.write(byt, off, len);
      b.write(byt, off, len);
    }
  };
}

Author comment

Began life as a copy of #1017323

download  show line numbers  debug dex  old transpilations   

Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1017324
Snippet name: teeOutputStream - splitting OutputStream
Eternal ID of this version: #1017324/2
Text MD5: 314e6da3ea5991f4223b0d27a2df6121
Author: stefan
Category: javax / io
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-07-16 21:18:09
Source code size: 417 bytes / 15 lines
Pitched / IR pitched: No / No
Views / Downloads: 261 / 293
Version history: 1 change(s)
Referenced in: [show references]