color palettes, fps in overlay, main menu screen w/ buttons
This commit is contained in:
@@ -72,9 +72,11 @@ public class FileTreeDiff {
|
||||
ck1.reset();
|
||||
ck2.reset();
|
||||
|
||||
try (FileInputStream in1 = new FileInputStream(pair.a); FileInputStream in2 = new FileInputStream(pair.b)) {
|
||||
try(FileInputStream in1 = new FileInputStream(pair.a);
|
||||
FileInputStream in2 = new FileInputStream(pair.b)) {
|
||||
|
||||
try (CheckedInputStream cin1 = new CheckedInputStream(in1, ck1); CheckedInputStream cin2 = new CheckedInputStream(in2, ck2)) {
|
||||
try(CheckedInputStream cin1 = new CheckedInputStream(in1, ck1);
|
||||
CheckedInputStream cin2 = new CheckedInputStream(in2, ck2)) {
|
||||
|
||||
while (true) {
|
||||
final int read1 = cin1.read(BUFFER);
|
||||
|
||||
@@ -95,7 +95,8 @@ public class FileUtils {
|
||||
public static void copyFile(File source, File target) throws IOException
|
||||
{
|
||||
|
||||
try (InputStream in = new FileInputStream(source); OutputStream out = new FileOutputStream(target)) {
|
||||
try(InputStream in = new FileInputStream(source);
|
||||
OutputStream out = new FileOutputStream(target)) {
|
||||
|
||||
copyStream(in, out);
|
||||
}
|
||||
@@ -160,7 +161,7 @@ public class FileUtils {
|
||||
*/
|
||||
public static String fileToString(File file) throws IOException
|
||||
{
|
||||
try (FileInputStream fin = new FileInputStream(file)) {
|
||||
try(FileInputStream fin = new FileInputStream(file)) {
|
||||
|
||||
return streamToString(fin);
|
||||
}
|
||||
@@ -360,7 +361,7 @@ public class FileUtils {
|
||||
*/
|
||||
public static void stringToFile(File file, String text) throws IOException
|
||||
{
|
||||
try (PrintStream out = new PrintStream(new FileOutputStream(file), false, "UTF-8")) {
|
||||
try(PrintStream out = new PrintStream(new FileOutputStream(file), false, "UTF-8")) {
|
||||
|
||||
out.print(text);
|
||||
|
||||
@@ -481,7 +482,8 @@ public class FileUtils {
|
||||
*/
|
||||
public static void resourceToFile(String resname, File file) throws IOException
|
||||
{
|
||||
try (InputStream in = FileUtils.getResource(resname); OutputStream out = new FileOutputStream(file)) {
|
||||
try(InputStream in = FileUtils.getResource(resname);
|
||||
OutputStream out = new FileOutputStream(file)) {
|
||||
|
||||
FileUtils.copyStream(in, out);
|
||||
}
|
||||
@@ -498,7 +500,7 @@ public class FileUtils {
|
||||
*/
|
||||
public static String resourceToString(String resname) throws IOException
|
||||
{
|
||||
try (InputStream in = FileUtils.getResource(resname)) {
|
||||
try(InputStream in = FileUtils.getResource(resname)) {
|
||||
return streamToString(in);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ public class Ion {
|
||||
*/
|
||||
public static Object fromFile(File file) throws IonException
|
||||
{
|
||||
try (InputStream in = new FileInputStream(file)) {
|
||||
try(InputStream in = new FileInputStream(file)) {
|
||||
|
||||
final Object obj = fromStream(in);
|
||||
return obj;
|
||||
@@ -113,7 +113,7 @@ public class Ion {
|
||||
*/
|
||||
public static void toFile(File path, Object obj) throws IonException
|
||||
{
|
||||
try (OutputStream out = new FileOutputStream(path)) {
|
||||
try(OutputStream out = new FileOutputStream(path)) {
|
||||
final String f = path.toString();
|
||||
final File dir = new File(f.substring(0, f.lastIndexOf(File.separator)));
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@ public class ZipBuilder {
|
||||
|
||||
out.putNextEntry(new ZipEntry(path));
|
||||
|
||||
try (InputStream in = FileUtils.stringToStream(text)) {
|
||||
try(InputStream in = FileUtils.stringToStream(text)) {
|
||||
FileUtils.copyStream(in, out);
|
||||
}
|
||||
}
|
||||
@@ -96,7 +96,7 @@ public class ZipBuilder {
|
||||
|
||||
out.putNextEntry(new ZipEntry(path));
|
||||
|
||||
try (InputStream in = FileUtils.getResource(resPath)) {
|
||||
try(InputStream in = FileUtils.getResource(resPath)) {
|
||||
FileUtils.copyStream(in, out);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ public class ZipUtils {
|
||||
*/
|
||||
public static List<String> extractZip(File file, File outputDir, StringFilter filter) throws IOException
|
||||
{
|
||||
try (ZipFile zip = new ZipFile(file)) {
|
||||
try(ZipFile zip = new ZipFile(file)) {
|
||||
return extractZip(zip, outputDir, filter);
|
||||
}
|
||||
}
|
||||
@@ -90,7 +90,7 @@ public class ZipUtils {
|
||||
*/
|
||||
public static List<String> listZip(File zipFile) throws IOException
|
||||
{
|
||||
try (ZipFile zip = new ZipFile(zipFile)) {
|
||||
try(ZipFile zip = new ZipFile(zipFile)) {
|
||||
return listZip(zip);
|
||||
}
|
||||
}
|
||||
@@ -134,7 +134,10 @@ public class ZipUtils {
|
||||
{
|
||||
if (!destFile.getParentFile().mkdirs()) throw new IOException("Could not create output directory.");
|
||||
|
||||
try (InputStream in = zip.getInputStream(entry); BufferedInputStream is = new BufferedInputStream(in); FileOutputStream fos = new FileOutputStream(destFile); BufferedOutputStream dest = new BufferedOutputStream(fos, BUFFER_SIZE)) {
|
||||
try(InputStream in = zip.getInputStream(entry);
|
||||
BufferedInputStream is = new BufferedInputStream(in);
|
||||
FileOutputStream fos = new FileOutputStream(destFile);
|
||||
BufferedOutputStream dest = new BufferedOutputStream(fos, BUFFER_SIZE)) {
|
||||
|
||||
FileUtils.copyStream(is, dest);
|
||||
}
|
||||
@@ -168,7 +171,7 @@ public class ZipUtils {
|
||||
|
||||
public static boolean entryExists(File selectedFile, String string)
|
||||
{
|
||||
try (ZipFile zf = new ZipFile(selectedFile)) {
|
||||
try(ZipFile zf = new ZipFile(selectedFile)) {
|
||||
return zf.getEntry(string) != null;
|
||||
} catch (final IOException | RuntimeException e) {
|
||||
Log.w("Error reading zip.", e);
|
||||
|
||||
Reference in New Issue
Block a user