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

21
LINES

< > BotCompany Repo | #1002693 // Test serveHttp with filtered input/output streams

JavaX source code [tags: use-pretranspiled] - run with: x30.jar

Libraryless. Click here for Pure Java version (2864L/22K/57K).

1  
!752
2  
3  
p {
4  
  serveHttp(7777);
5  
}
6  
7  
static NanoHTTPD.Response serve(S uri, NanoHTTPD.Method method,
8  
  Map<S,S> header, Map<S,S> parms, Map<S,S> files) {
9  
  print("Serving HTML.");
10  
  ret serveHTML("Hello world (as usual...)");
11  
}
12  
13  
static InputStream wrap(InputStream in, L more) {
14  
  print("Wrapping input stream... " + identityHashCode(in));
15  
  ret new FilterInputStream(in) {};
16  
}
17  
18  
static OutputStream wrap(OutputStream out, L more) {
19  
  print("Wrapping output stream... " + identityHashCode(out));
20  
  ret new FilterOutputStream(out);
21  
}

Author comment

Began life as a copy of #1001649

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1002693
Snippet name: Test serveHttp with filtered input/output streams
Eternal ID of this version: #1002693/1
Text MD5: acc08a8c54d0b7e62131979edc3600cb
Transpilation MD5: d925b0098bbd986cc7ee757a7331cb89
Author: stefan
Category: javax
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-02-14 23:13:13
Source code size: 548 bytes / 21 lines
Pitched / IR pitched: No / No
Views / Downloads: 561 / 596
Referenced in: [show references]