-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCompressedStreamTools.java
More file actions
60 lines (53 loc) · 1.76 KB
/
CompressedStreamTools.java
File metadata and controls
60 lines (53 loc) · 1.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
package net.minecraft.src;
// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) braces deadcode
import java.io.*;
import java.util.zip.GZIPInputStream;
import java.util.zip.GZIPOutputStream;
public class CompressedStreamTools
{
public CompressedStreamTools()
{
}
public static NBTTagCompound func_1138_a(InputStream inputstream) throws IOException
{
DataInputStream datainputstream = new DataInputStream(new GZIPInputStream(inputstream));
try
{
NBTTagCompound nbttagcompound = func_1141_a(datainputstream);
return nbttagcompound;
}
finally
{
datainputstream.close();
}
}
public static void writeGzippedCompoundToOutputStream(NBTTagCompound nbttagcompound, OutputStream outputstream) throws IOException
{
DataOutputStream dataoutputstream = new DataOutputStream(new GZIPOutputStream(outputstream));
try
{
func_1139_a(nbttagcompound, dataoutputstream);
}
finally
{
dataoutputstream.close();
}
}
public static NBTTagCompound func_1141_a(DataInput datainput) throws IOException
{
NBTBase nbtbase = NBTBase.readTag(datainput);
if(nbtbase instanceof NBTTagCompound)
{
return (NBTTagCompound)nbtbase;
} else
{
throw new IOException("Root tag must be a named compound tag");
}
}
public static void func_1139_a(NBTTagCompound nbttagcompound, DataOutput dataoutput) throws IOException
{
NBTBase.writeTag(nbttagcompound, dataoutput);
}
}