public void testEncryptDecryptRandomAccess(
      int keySizeInBytes,
      int tagSizeInBytes,
      int segmentSize,
      int firstSegmentOffset,
      int plaintextSize)
      throws Exception {
    byte[] ikm = Hex.decode("000102030405060708090a0b0c0d0e0f00112233445566778899aabbccddeeff");
    AesCtrHmacStreaming ags =
        new AesCtrHmacStreaming(ikm, "HmacSha256", keySizeInBytes, "HmacSha256",
            tagSizeInBytes, segmentSize, firstSegmentOffset);
    StreamingTestUtil.testEncryptDecryptRandomAccess(ags, firstSegmentOffset, plaintextSize);
  }
Encrypt and then decrypt partially, and check that the result is the same.
java_src/src/test/java/com/google/crypto/tink/subtle/AesCtrHmacStreamingTest.java