List of utility methods to do UTF8
boolean | backup(String inputFile, String backupFile) backup return backup(new File(inputFile), new File(backupFile)); |
String | codeListToString(List convert utf8 code list to string ByteArrayOutputStream buffer = new ByteArrayOutputStream(); for (int code : utf8CodeList) { codeToString(buffer, code); return new String(buffer.toByteArray(), DEFAULT_CHARSET); |
String | codesToString(int[] utf8Codes) convert utf8 codes to string List<Integer> codeList = new ArrayList<>(utf8Codes.length); for (int code : utf8Codes) { codeList.add(code); return codeListToString(codeList); |
String | codeToString(int utf8Code) convert utf8 code to string return codesToString(new int[] { utf8Code }); |
boolean | compareWithGold(String goldfile, String outputfile) Compare contents of golden file with test output file line by line. return compareWithGold(goldfile, outputfile, StandardCharsets.UTF_8);
|
String | convertISO8859_1_to_UTF_8(String s) convert IStUT_ if (s == null) { return null; } else { return new String(s.getBytes(Charset.forName(ISO_8859_1)), Charset.forName(UTF_8)); |
java.lang.String | ConvertUTF8(byte[] buffer) Convert UTF return new String(buffer, java.nio.charset.StandardCharsets.UTF_8); |
void | createFileAndExport(String inputFileName, String outputFileName, String outputStr) create File And Export FileChannel inputChannel = null; FileChannel outputChannel = null; try { File input = new File(inputFileName); File output = new File(outputFileName); inputChannel = new FileInputStream(input).getChannel(); outputChannel = new FileOutputStream(output).getChannel(); outputChannel.transferFrom(inputChannel, 0, inputChannel.size()); ... |
DatagramPacket | createFromUTF8String(DatagramPacket packet, String str) create From UTF String byte[] b = str.getBytes(utf8); return new DatagramPacket(b, b.length); |
Path | createTemporaryOutputFolder() create Temporary Output Folder Path tmp = Files.createTempDirectory("glove-test-dir"); tmp.toFile().deleteOnExit(); return tmp; |