src/org/kocakosm/pitaya/charset/UTF8.java
public static boolean canDecode(byte[] input, int off, int len)
	{
		try {
			decode(input, off, len);
		} catch (IllegalArgumentException ex) {
			return false;
		}
		return true;
	}
public static boolean canDecode(byte[] input, int off, int len)
	{
		try {
			decode(input, off, len);
		} catch (IllegalArgumentException ex) {
			return false;
		}
		return true;
	}
Returns whether the specified range in the given byte array represents
valid UTF-8 encoded characters.

@param input the input buffer.
@param off the start index, inclusive.
@param len the number of bytes to test.

@return whether the specified range in {@code input} represents UTF-8
encoded characters.

@throws NullPointerException if {@code input} is {@code null}.
@throws IndexOutOfBoundsException if {@code off} or {@code len} is
negative or if {@code off + len} is greater than {@code input}'s
length.