class StringUtilities {

	public static String toQuotedString(byte[] bytes) {
		StringBuilder builder = new StringBuilder();
		for (byte b : bytes) {
			appendCharConvertedToEscapeSequence((char) (b & 0xff), 1, builder);
		}
		String str = builder.toString();
		if (bytes.length == 1) {
			str = str.replace("'", "\\'");
			return "'" + str + "'";
		}
		str = str.replace("\"", "\\\"");
		return "\"" + str + "\"";
	}

	private  StringUtilities();

}