(byte[] result, int length)
| 193 | // TODO(lowasser): document the extent of leniency, probably after adding ignore(CharMatcher) |
| 194 | |
| 195 | private static byte[] extract(byte[] result, int length) { |
| 196 | if (length == result.length) { |
| 197 | return result; |
| 198 | } else { |
| 199 | byte[] trunc = new byte[length]; |
| 200 | System.arraycopy(result, 0, trunc, 0, length); |
| 201 | return trunc; |
| 202 | } |
| 203 | } |
| 204 | |
| 205 | /** |
| 206 | * Determines whether the specified character sequence is a valid encoded string according to this |