private void readSomeCiphertext(ByteBuffer buffer) throws IOException {
    int read;
    do {
      read = ciphertextChannel.read(buffer);
    } while (read > 0 && buffer.remaining() > 0);
    if (read == -1) {
      endOfCiphertext = true;
    }
  }
Reads some ciphertext.
@param buffer the destination for the ciphertext.
@throws IOException when an exception reading the ciphertext stream occurs.
java_src/src/main/java/com/google/crypto/tink/subtle/StreamingAeadDecryptingChannel.java