forked from cybertiger/Bukkit-LibNBT
-
Notifications
You must be signed in to change notification settings - Fork 0
/
TagInputStreamTest.java
38 lines (31 loc) · 1.01 KB
/
TagInputStreamTest.java
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
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.cyberiantiger.minecraft.nbt;
import java.io.IOException;
import java.io.InputStream;
import java.util.zip.GZIPInputStream;
import org.junit.Test;
/**
*
* @author antony
*/
public class TagInputStreamTest {
@Test
public void testParse() throws IOException {
InputStream in;
in = TagInputStreamTest.class.getResourceAsStream("level.dat");
try (TagInputStream tin = new TagInputStream(new GZIPInputStream(in))) {
System.out.println(tin.readTag());
}
in = TagInputStreamTest.class.getResourceAsStream("hello_world.nbt");
try (TagInputStream tin = new TagInputStream(in)) {
System.err.println(tin.readTag());
}
in = TagInputStreamTest.class.getResourceAsStream("bigtest.nbt");
try (TagInputStream tin = new TagInputStream(new GZIPInputStream(in))) {
System.err.println(tin.readTag());
}
}
}