202N/A * The contents of this file are subject to the terms of the 202N/A * Common Development and Distribution License (the "License"). 202N/A * You may not use this file except in compliance with the License. 202N/A * language governing permissions and limitations under the License. 202N/A * When distributing Covered Code, include this CDDL HEADER in each 202N/A * If applicable, add the following below this CDDL HEADER, with the 202N/A * fields enclosed by brackets "[]" replaced with your own identifying 202N/A * information: Portions Copyright [yyyy] [name of copyright owner] 1127N/A * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. 956N/A * Check whether the byte array contains plain text. First, check 956N/A * assuming US-ASCII encoding. Then, if unsuccessful, try to 956N/A * strip away Unicode byte-order marks and try again. 956N/A * Check whether the string only contains plain ASCII characters. 504N/A if ((b >=
32 && b <
127) ||
// ASCII printable characters 504N/A (b ==
9) ||
// horizontal tab 504N/A (b ==
10) ||
// line feed 504N/A (b ==
12) ||
// form feed 504N/A (b ==
13)) {
// carriage return 504N/A // is plain text so far, go to next byte 202N/A // 8-bit values or unprintable control characters, 202N/A // probably not plain text