List of utility methods to do UTF8
byte[] | getBytesUtf8(final String string) Encodes the given string into a sequence of bytes using the UTF-8 charset, storing the result into a new byte array. return getBytes(string, StandardCharsets.UTF_8);
|
File | getFile(String outputFolder, String fileName) get File File file = Paths.get(outputFolder, fileName).toFile();
return file;
|
ArrayList | getFiles(String InputFilePath) get Files ArrayList<File> fileList = new ArrayList<File>(); File dir = null; String filePattern = null; InputFilePath.trim(); if (InputFilePath.lastIndexOf('/') > 0) { dir = new File((InputFilePath.substring(0, InputFilePath.lastIndexOf('/') + 1) == "" ? "." : InputFilePath.substring(0, InputFilePath.lastIndexOf('/') + 1) + "\\")); filePattern = (InputFilePath.substring(InputFilePath.lastIndexOf('/') + 1)); ... |
List | getOutputFromCommand(boolean print, List Execute a shell command and retrieve its output. try { StringJoiner sj = new StringJoiner(" ", "$ ", ""); command.stream().forEach(sj::add); System.out.println(sj.toString()); Path tempFile = Files.createTempFile("test-output", null); ProcessBuilder builder = new ProcessBuilder(command); builder.redirectErrorStream(true); builder.redirectOutput(Redirect.to(tempFile.toFile())); ... |
String | getStringFromUTF8Bytes(byte[] utf8Bytes) get String From UTF Bytes return new String(utf8Bytes, UTF_8); |
Charset | getUtf8() get Utf return UTF8;
|
Charset | getUTF8() get UTF return Charset.forName("UTF-8"); |
Charset | getUtf8() Simply returns the value of Charset#forName(String) with value of #UTF8_NAME . return Charset.forName(UTF8_NAME);
|
String | getUTF8(byte[] data, int offset, int length) get UTF return new String(data, offset, length, UTF8); |
byte[] | getUTF8Bytes(String s) get UTF Bytes if (s != null && s.length() >= 0) { return s.getBytes(UTF_8); return null; |