void checkIsOpen() throws ClosedChannelException {
      if (!isopen) {
        throw new ClosedChannelException();
      }
    }
keeps track whether the channel is still open.
java_src/src/main/java/com/google/crypto/tink/testing/StreamingTestUtil.java