]> gitweb.fperrin.net Git - DictionaryPC.git/blobdiff - src/com/hughes/android/dictionary/engine/ReadAheadBuffer.java
Minor automated code simplifications.
[DictionaryPC.git] / src / com / hughes / android / dictionary / engine / ReadAheadBuffer.java
index 3c4c10d0aeebf2442a69fda3ba5619e94adc7c8b..b38ee2b9785f9feae050670ef8feadc9208946c0 100644 (file)
@@ -27,21 +27,19 @@ public class ReadAheadBuffer extends PipedInputStream {
         try {
             pipe = new PipedOutputStream(this);
         } catch (IOException e) {}
-        new Thread(new Runnable() {
-            public void run() {
-                try {
-                    int read;
-                    final byte buffer[] = new byte[BLOCK_SIZE];
-                    while ((read = in.read(buffer)) > 0)
-                    {
-                        pipe.write(buffer, 0, read);
-                        pipe.flush();
-                    }
-                } catch (IOException e) {}
-                try {
-                    pipe.close();
-                } catch (IOException e) {}
-            }
+        new Thread(() -> {
+            try {
+                int read;
+                final byte[] buffer = new byte[BLOCK_SIZE];
+                while ((read = in.read(buffer)) > 0)
+                {
+                    pipe.write(buffer, 0, read);
+                    pipe.flush();
+                }
+            } catch (IOException e) {}
+            try {
+                pipe.close();
+            } catch (IOException e) {}
         }).start();
     }