I am trying to convert a Shift_JIS formatted file into UTF-8 format. For this, below is my approach:
If you want to copy inFile (SHift_JIS) to outFile (UTF-8).
try (Reader reader = new InputStreamReader(new FileInputStream(inFile), "Shift_JIS");
Writer writer = new OutputStreamWriter(new FileOutputStream(outFile), "UTF-8")) {
char[] buffer = new char[4096];
int size;
while ((size = reader.read(buffer)) >= 0)
writer.write(buffer, 0, size);
}