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

24
LINES

< > BotCompany Repo | #1035678 // LoggingBitHead

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

Libraryless. Click here for Pure Java version (9816L/55K).

1  
sclass LoggingBitHead > BitHead {
2  
  class Event {
3  
    long byteCounter = LoggingBitHead.this.byteCounter;
4  
    int align = LoggingBitHead.this.align;
5  
    int currentByte = LoggingBitHead.this.currentByte;
6  
  }
7  
  
8  
  record WritingBit(bool b) > Event {}
9  
  record WritingByte(int i) > Event {}
10  
  
11  
  event log(Event event);
12  
  
13  
  bool writeArraysSlowly() { true; }
14  
  
15  
  void writeBit(bool b) {
16  
    log(new WritingBit(b));
17  
    super.writeBit(b);
18  
  }
19  
  
20  
  void writeByte(int i) {
21  
    log(new WritingByte(i));
22  
    super.writeByte(i);
23  
  }
24  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 2 computer(s): elmgxqgtpvxh, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1035678
Snippet name: LoggingBitHead
Eternal ID of this version: #1035678/3
Text MD5: 9b269a4654900bd2d67cfe29fa4cfd6b
Transpilation MD5: d694a68d29477f78b490fb1738f82683
Author: stefan
Category: javax / huffman encoding
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-07-06 19:39:03
Source code size: 552 bytes / 24 lines
Pitched / IR pitched: No / No
Views / Downloads: 69 / 112
Version history: 2 change(s)
Referenced in: [show references]