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

12
LINES

< > BotCompany Repo | #1005538 // loadGZTextFile

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (2543L/16K).

1  
sS loadGZTextFile(File file) ctex {
2  
  if (!file.isFile()) ret null;
3  
  ping();
4  
  new ByteArrayOutputStream baos;
5  
  temp InputStream fis = new FileInputStream(file);
6  
  GZIPInputStream gis = newGZIPInputStream(fis);
7  
  byte[] buffer = new byte[1024];
8  
  int len;
9  
  while ((len = gis.read(buffer)) != -1) baos.write(buffer, 0, len);
10  
  baos.close();
11  
  return fromUtf8(baos.toByteArray()); // TODO: use a Reader
12  
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1005538
Snippet name: loadGZTextFile
Eternal ID of this version: #1005538/4
Text MD5: 38b1f57551400145e74997b2e9f83b1b
Transpilation MD5: 1e52c2db15d8f96c2d513ed3640d64d7
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-08-27 17:17:04
Source code size: 416 bytes / 12 lines
Pitched / IR pitched: No / No
Views / Downloads: 667 / 712
Version history: 3 change(s)
Referenced in: [show references]