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)

1  
static OutputStream teeOutputStream(final OutputStream a, final OutputStream b) {
2  
  if (a == null) ret b;
3  
  if (b == null) ret a;
4  
  ret new OutputStream {
5  
    public void write(int byt) throws IOException {
6  
      a.write(byt);
7  
      b.write(byt);
8  
    }
9  
    
10  
    public void write(byte[] byt, int off, int len) throws IOException {
11  
      a.write(byt, off, len);
12  
      b.write(byt, off, len);
13  
    }
14  
  };
15  
}

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: 379 / 402
Version history: 1 change(s)
Referenced in: [show references]