MCPcopy Create free account
hub / github.com/DeNA/PacketProxy / ungzip

Method ungzip

src/main/java/core/packetproxy/common/Utils.java:248–261  ·  view source on GitHub ↗
(byte[] src)

Source from the content-addressed store, hash-verified

246 }
247
248 public static byte[] ungzip(byte[] src) throws Exception {
249 ByteArrayOutputStream out = new ByteArrayOutputStream();
250 GZIPInputStream gzis = new GZIPInputStream(new ByteArrayInputStream(src));
251 byte[] buf = new byte[1024];
252 while (true) {
253
254 int len = gzis.read(buf);
255 if (len < 0)
256 break;
257
258 out.write(buf, 0, len);
259 }
260 return out.toByteArray();
261 }
262
263 public static byte[] replaceArray(byte[] src, Range area, byte[] replacer) {
264 return replaceArray(src, area.getPositionStart(), area.getPositionEnd(), replacer);

Callers

nothing calls this directly

Calls 3

writeMethod · 0.65
readMethod · 0.45
toByteArrayMethod · 0.45

Tested by

no test coverage detected