public ByteStringBuilder appendUtf8(CodePointIterator iterator) { while (iterator.hasNext()) { appendUtf8Raw(iterator.next()); } return this; }
/** * Determine if the remaining contents of this iterator are identical to the given string. If the * contents are not equal, the iterator will be positioned at the location of the first difference (i.e. the code point * returned by {@link #next()} will be the differing code point. If the contents are equal, the iterator will be * positioned at the end of its contents. * * @param other the other string * @return {@code true} if the contents are equal, {@code false} otherwise */ public boolean contentEquals(String other) { return contentEquals(CodePointIterator.ofString(other)); }
/** * Get an iterator over this principal. * * @return an iterator over this principal (not {@code null}) */ public Iterator<Principal> iterator() { return new ArrayIterator<Principal>(p); }
@Override public TransformationSpec[] getTransformationSpecByStrength(String mechanism, String... tokens) throws IllegalArgumentException { return getTransformationSpecByStrength(null, mechanism, tokens); }
/** * Implementation of the {@code engineToString} method. * * @return the string representation */ protected String engineToString() { return "AlgorithmParametersSpi for " + getParameterType(); } }
/** * Get the next element in the direction of this iterator. * * @return the next element */ default E nextElement() { return next(); }
/** * Base32-decode the current stream. * * @param alphabet the alphabet to use * @return an iterator over the decoded bytes */ public ByteIterator base32Decode(final Base32Alphabet alphabet) { return super.base32Decode(alphabet, true); }
/** * Get a byte iterator over the UTF-8 encoding of this code point iterator. * * @return the byte iterator */ public ByteIterator asUtf8() { return asUtf8(false); }
/** * Get a code point iterator for a ISO-8859-1 (Latin-1) encoded array. * * @param bytes the array * @return the code point iterator */ public static CodePointIterator ofLatin1Bytes(final byte[] bytes) { return ofLatin1Bytes(bytes, 0, bytes.length); }
/** * Base64-decode the current stream, assuming that the byte data is encoded in an ASCII-derived encoding. * * @param alphabet the alphabet to use * @return an iterator over the decoded bytes */ public ByteIterator base64Decode(final Base64Alphabet alphabet) { return super.base64Decode(alphabet, true); }
int calc3(final int b2) { // d3 = r2[7..2] return alphabet.encode((b2 >> 2) & 0x3f); } };
int calc7(final int b4) { // d7 = r4[7..3] return alphabet.encode((b4 >> 3) & 0x1f); } };
public ByteStringBuilder appendTo(final ByteStringBuilder builder) { builder.append(bytes, offs + idx, len - idx); idx = len; return builder; } };