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).

// runDecompressor is expected to return byte array, byte list or byte iterator
interface CompressionRegime<A> extends CompressionRegime_AnyType<A> {
  default byte[] runDecompressorToBytes(A a) {
    ret toByteArray(runDecompressor(a));
  }
  
  default byte[] decompress(byte[] compressed) {
    ret toByteArray(runDecompressor(decompressorFromBytes(compressed)));
  }
  
  default L<Byte> decompressToByteList(byte[] compressed) {
    ret toByteList(runDecompressor(decompressorFromBytes(compressed)));
  }
  
  default Iterator<Byte> decompressToByteIterator(byte[] compressed) {
    ret toByteIterator(runDecompressor(decompressorFromBytes(compressed)));
  }
}

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: 36 / 81
Version history: 11 change(s)
Referenced in: [show references]