Skip to content
This repository was archived by the owner on Jul 22, 2024. It is now read-only.

Commit 2a7e75e

Browse files
authored
Merge pull request #174 from thejunkjon/master
Some minor clean-up in XmlDecompressor
2 parents 25d0b27 + 072835f commit 2a7e75e

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

ClassySharkWS/src/com/google/classyshark/silverghost/translator/xml/XmlDecompressor.java

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,10 @@
2020

2121
import java.io.ByteArrayInputStream;
2222
import java.io.DataInput;
23-
import java.io.File;
24-
import java.io.FileInputStream;
2523
import java.io.IOException;
2624
import java.io.InputStream;
2725
import java.nio.ByteBuffer;
2826
import java.nio.ByteOrder;
29-
import java.nio.IntBuffer;
3027
import java.util.ArrayList;
3128
import java.util.Arrays;
3229
import java.util.List;
@@ -57,7 +54,7 @@ public class XmlDecompressor {
5754

5855
private static final int RES_XML_RESOURCE_MAP_TYPE = 0x180;
5956
private static final int RES_XML_FIRST_CHUNK_TYPE = 0x100;
60-
private static final int REX_XML_STRING_TABLE = 0x0001;
57+
private static final int RES_XML_STRING_TABLE = 0x0001;
6158

6259
//Resource Types
6360
private static final int RES_TYPE_NULL = 0x00;
@@ -128,7 +125,7 @@ public String decompressXml(byte[] bytes) throws IOException {
128125
public String decompressXml(InputStream is) throws IOException {
129126
StringBuilder result = new StringBuilder("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
130127
try(LittleEndianDataInputStream dis = new LittleEndianDataInputStream(is)) {
131-
//Getting and checking the marker for a valid XMl file
128+
//Getting and checking the marker for a valid XML file
132129
int fileMarker = dis.readInt();
133130
if (fileMarker != PACKED_XML_IDENTIFIER) {
134131
throw new IOException(
@@ -181,7 +178,7 @@ private void parseCDataTag(StringBuilder sb, DataInput dis, List<String> strings
181178
//Skipping 3 unknowns integers:
182179
dis.skipBytes(8);
183180
int nameStringIndex = dis.readInt();
184-
//Skipping more 2 unknown integers.
181+
//Skipping 2 more unknown integers.
185182
dis.skipBytes(8);
186183

187184
if (appendCData) {
@@ -304,7 +301,7 @@ private void parseAttributes(StringBuilder sb, DataInput dis, List<String> strin
304301

305302
private List<String> parseStrings(DataInput dis) throws IOException {
306303
int stringMarker = dis.readShort();
307-
if (stringMarker != REX_XML_STRING_TABLE) {
304+
if (stringMarker != RES_XML_STRING_TABLE) {
308305
throw new IOException(
309306
String.format(ERROR_INVALID_MAGIC_NUMBER,
310307
PACKED_XML_IDENTIFIER,

0 commit comments

Comments
 (0)