@Override
    public void run() {
      try {
        byte[] chunk = new byte[chunkSize];
        while (plaintext.remaining() >= chunkSize) {
          int read = channel.read(ByteBuffer.wrap(chunk));
          assertEquals(read, chunkSize);
          plaintext.put(chunk);
        }
        channel.read(plaintext);
        assertEquals(0, plaintext.remaining());
      } catch (IOException ex) {
        getUncaughtExceptionHandler().uncaughtException(this, ex);
      }
    }
Read the plaintext from the channel. This implementation assumes that the channel is blocking
and throws an AssertionError if an attempt to read plaintext from the channel is incomplete.
java_src/src/test/java/com/google/crypto/tink/subtle/StreamingAeadThreadSafetyTest.java