public synchronized void rewind() throws IOException {
    if (!canRewind) {
      throw new IOException("Cannot rewind anymore.");
    }
    if (buffer != null) {
      buffer.position(0);
    }
  }
Rewinds this buffer to the beginning (if rewinding is still enabled).
java_src/src/main/java/com/google/crypto/tink/subtle/RewindableReadableByteChannel.java