public void testEncryptSingleBytes(int keySizeInBytes, int plaintextSize) throws Exception {
    int firstSegmentOffset = 0;
    int segmentSize = 512;
    int tagSizeInBytes = 12;
    byte[] ikm = Hex.decode("000102030405060708090a0b0c0d0e0f00112233445566778899aabbccddeeff");
    AesCtrHmacStreaming ags = new AesCtrHmacStreaming(ikm, "HmacSha256", keySizeInBytes,
        "HmacSha256", tagSizeInBytes, segmentSize, firstSegmentOffset);
    StreamingTestUtil.testEncryptSingleBytes(ags, plaintextSize);
  }
One case that is sometimes problematic is writing single bytes to a stream. This test
constructs an OutputStream from a WritableByteChannel and tests whether encryption works on
this stream.
java_src/src/test/java/com/google/crypto/tink/subtle/AesCtrHmacStreamingTest.java