+ //
+ // GZIPInputStream code borrowed from Aquaria (soon to be open sourced) via Kenny Sabir
+ Exception e=null;
+ if (fileStr.endsWith(".gz")) {
+ try {
+ InputStream inputStream = url.openStream();
+ dataIn = new BufferedReader(new InputStreamReader(new GZIPInputStream(inputStream)));
+ dataIn.mark(2048);
+ dataIn.read();
+ dataIn.reset();
+
+ dataName = fileStr;
+ return false;
+ } catch (Exception ex) {
+ e=ex;
+ }
+ }
+
+ try {
+ dataIn = new BufferedReader(new InputStreamReader(url.openStream()));
+ } catch (IOException q) {
+ if (e!=null)
+ {
+ throw new IOException("Failed to resolve GZIP stream", e);
+ }
+ throw q;
+ }