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

18
LINES

< > BotCompany Repo | #1033081 // CompressionRegime

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

Libraryless. Click here for Pure Java version (4728L/27K).

1  
// runDecompressor is expected to return byte array, byte list or byte iterator
2  
interface CompressionRegime<A> extends CompressionRegime_AnyType<A> {
3  
  default byte[] runDecompressorToBytes(A a) {
4  
    ret toByteArray(runDecompressor(a));
5  
  }
6  
  
7  
  default byte[] decompress(byte[] compressed) {
8  
    ret toByteArray(runDecompressor(decompressorFromBytes(compressed)));
9  
  }
10  
  
11  
  default L<Byte> decompressToByteList(byte[] compressed) {
12  
    ret toByteList(runDecompressor(decompressorFromBytes(compressed)));
13  
  }
14  
  
15  
  default Iterator<Byte> decompressToByteIterator(byte[] compressed) {
16  
    ret toByteIterator(runDecompressor(decompressorFromBytes(compressed)));
17  
  }
18  
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1033081
Snippet name: CompressionRegime
Eternal ID of this version: #1033081/12
Text MD5: 9d9788e32be056ecadddbaa3b7bf1c22
Transpilation MD5: 3bdb16871b051816e1df243306d750a7
Author: stefan
Category: javax / recognition by compression
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-10-15 20:36:07
Source code size: 682 bytes / 18 lines
Pitched / IR pitched: No / No
Views / Downloads: 205 / 342
Version history: 11 change(s)
Referenced in: [show references]