List of utility methods to do UTF8 File Read
String | readAsUTF8(String text) read As UTF if (text == null) return null; return new String(text.getBytes(ENC_LATIN1), ENC_UTF8); |
List | readLines(File inputFile) read lines from the given inputFile List<String> list = Files.readAllLines(inputFile.toPath(), Charset.defaultCharset());
return list;
|
String | readRawUTF8Bytes(final byte[] bytes) Generates a String that is populated with the UTF-8 decoding of the provided byte array. return new String(bytes, StandardCharsets.UTF_8); |
String | readResourceUtf8(Class> contextClass, String filename) Loads a file (specified relative to the contextClass) as a string, assuming UTF-8 encoding. return resourceToString(getResource(contextClass, filename));
|
String | readStringFromUTF8Stream(InputStream is) read String From UTF Stream return readString(is, StandardCharsets.UTF_8.name());
|
String | readStringUTF16LE(byte[] var0, int var1, int var2) read String UTFLE int var3 = 0; for (int var4 = 0; var4 < var2; ++var4) { if (var0[var1 + var4] == 37) { var3 = var4; break; return new String(var0, var1, var3, Charset.forName("UTF-16LE")); ... |
List | readTextFile(File inputFile) read Text File return readText(new InputStreamReader(new FileInputStream(inputFile), Charset.forName("UTF-8"))); |
String | readUTF8(DataInput buf) Reads an UTF8 string from a byte buffer. final int len = readVarInt(buf); final byte[] bytes = new byte[len]; buf.readFully(bytes); return new String(bytes, StandardCharsets.UTF_8); |
String | readUtf8String(DataInputStream in) Reads a UTF-8 encoded string from the buffer. int len = in.readUnsignedShort(); byte[] bytes = new byte[len]; in.readFully(bytes); return new String(bytes, CHARSET_UTF8); |
String | readUTFByteArrayFromDataInput(final DataInput in) Reads a string from the given DataInput. int length = in.readInt(); byte[] byteArray = new byte[length]; in.readFully(byteArray); return new String(byteArray, StandardCharsets.UTF_8); |