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

27
LINES

< > BotCompany Repo | #1031081 - Test gzipOutputStream_syncFlush (doesn't work - file is missing gzip trailer)

JavaX source code (Dynamic Module) [tags: use-pretranspiled] - run with: Stefan's OS

Uses 974K of libraries. Click here for Pure Java version (6935L/37K).

!7

!include #1031088 // GZIPInputStream_relaxed
!include #1031089 // loadGZTextFile_relaxed

cmodule2 > DynTestModule {
  transient File file;
  transient PrintWriter writer;
  transient new StringBuilder buf;
  
  void printToFile(S s) {
    writer.print(s);
    writer.flush();
    buf.append(s);
    assertEqualsVerbose(str(buf), loadGZTextFile_relaxed(file));
  }
  
  void test {
    file = programFile("test.log.gz");
    deleteFile(file);
    writer = printWriter(gzipOutputStream_syncFlush(file));
    printToFile("Hello\n");
    printToFile("world\n");
    writer.close();
    printFileInfo(file);
  }
}

download  show line numbers  debug dex  old transpilations   

Travelled to 3 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx

No comments. add comment

Snippet ID: #1031081
Snippet name: Test gzipOutputStream_syncFlush (doesn't work - file is missing gzip trailer)
Eternal ID of this version: #1031081/7
Text MD5: c351585fa09a00486c45d3b20b036f52
Transpilation MD5: 06520b9aba37fe6f7faa026e06bdd39f
Author: stefan
Category: javax / io
Type: JavaX source code (Dynamic Module)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-04-30 23:51:39
Source code size: 639 bytes / 27 lines
Pitched / IR pitched: No / No
Views / Downloads: 24 / 78
Version history: 6 change(s)
Referenced in: [show references]

Formerly at http://tinybrain.de/1031081 & http://1031081.tinybrain.de