X-Git-Url: http://gitweb.fperrin.net/?p=DictionaryPC.git;a=blobdiff_plain;f=src%2Fcom%2Fhughes%2Fandroid%2Fdictionary%2Fengine%2FReadAheadBuffer.java;h=b38ee2b9785f9feae050670ef8feadc9208946c0;hp=3c4c10d0aeebf2442a69fda3ba5619e94adc7c8b;hb=2fc669d88306d563fc9c899d8d91b25d591692ea;hpb=1a83b46657501c96b7619b2f66f8b8229d1a2c0c diff --git a/src/com/hughes/android/dictionary/engine/ReadAheadBuffer.java b/src/com/hughes/android/dictionary/engine/ReadAheadBuffer.java index 3c4c10d..b38ee2b 100644 --- a/src/com/hughes/android/dictionary/engine/ReadAheadBuffer.java +++ b/src/com/hughes/android/dictionary/engine/ReadAheadBuffer.java @@ -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(); }