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

30
LINES

< > BotCompany Repo | #1031084 // Test deflaterOutputStream_syncFlush (OK)

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

Uses 1059K of libraries. Click here for Pure Java version (6799L/36K).

1  
!7
2  
3  
cmodule2 > DynTestModule {
4  
  transient File file;
5  
  transient PrintWriter writer;
6  
  transient new StringBuilder buf;
7  
  
8  
  void printToFile(S s) {
9  
    writer.print(s);
10  
    writer.flush();
11  
    buf.append(s);
12  
    checkFile();
13  
  }
14  
  
15  
  void checkFile {
16  
    printFileInfo(file);
17  
    assertEqualsVerbose(str(buf), loadDeflatedTextFile(file));
18  
  }
19  
  
20  
  void test {
21  
    file = programFile("test.log.deflated");
22  
    deleteFile(file);
23  
    writer = printWriter(deflaterOutputStream_syncFlush(file));
24  
    printToFile("Hello\n");
25  
    printToFile("world\n");
26  
    printToFile(repS("abc", 500));
27  
    writer.close();
28  
    checkFile();
29  
  }
30  
}

Author comment

Began life as a copy of #1031081

download  show line numbers  debug dex  old transpilations   

Travelled to 4 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, vouqrxazstgt

No comments. add comment

Snippet ID: #1031084
Snippet name: Test deflaterOutputStream_syncFlush (OK)
Eternal ID of this version: #1031084/5
Text MD5: 0ddafd86b9398909874fb6fe8952f14b
Transpilation MD5: fc4521c86c219e4289e1a946761e594d
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:45:49
Source code size: 655 bytes / 30 lines
Pitched / IR pitched: No / No
Views / Downloads: 174 / 304
Version history: 4 change(s)
Referenced in: [show references]