MCPcopy Create free account
hub / github.com/AstroImageJ/astroimagej / zipUncompress

Method zipUncompress

ij/src/main/java/ij/io/ImageReader.java:965–980  ·  view source on GitHub ↗

TIFF Adobe ZIP support contributed by Jason Newton.

(byte[] input)

Source from the content-addressed store, hash-verified

963
964 /** TIFF Adobe ZIP support contributed by Jason Newton. */
965 public byte[] zipUncompress(byte[] input) {
966 ByteArrayOutputStream imageBuffer = new ByteArrayOutputStream();
967 byte[] buffer = new byte[1024];
968 Inflater decompressor = new Inflater();
969 decompressor.setInput(input);
970 try {
971 while(!decompressor.finished()) {
972 int rlen = decompressor.inflate(buffer);
973 imageBuffer.write(buffer, 0, rlen);
974 }
975 } catch(Exception e){
976 IJ.log(e.toString());
977 }
978 decompressor.end();
979 return imageBuffer.toByteArray();
980 }
981
982 /**
983 * Utility method for decoding an LZW-compressed image strip.

Callers 1

uncompressMethod · 0.95

Calls 6

logMethod · 0.95
writeMethod · 0.65
endMethod · 0.65
setInputMethod · 0.45
toStringMethod · 0.45
toByteArrayMethod · 0.45

Tested by

no test coverage detected