Skip to content

Instantly share code, notes, and snippets.

@Nucleareal
Last active August 29, 2015 14:06
Show Gist options
  • Save Nucleareal/f3ba42841ae7f6d4414b to your computer and use it in GitHub Desktop.
Save Nucleareal/f3ba42841ae7f6d4414b to your computer and use it in GitHub Desktop.
import java.io.File;
import java.io.FileInputStream;
import javax.swing.JFileChooser;
public class Program
{
public static void main(String[] args)
{
JFileChooser filer = new JFileChooser();
int i = filer.showOpenDialog(null);
if(i == 0)
{
File file1 = filer.getSelectedFile();
try
{
{
FileInputStream fin = new FileInputStream(file1);
for(int k = 0; k < 20; k++)
{
int a = fin.read();
int b = fin.read();
byte[] bb = new byte[]{(byte)a, (byte)b};
System.out.print(new String(bb, "SJIS"));
}
System.out.println();
fin.close();
}
}
catch(Exception e)
{
e.printStackTrace();
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment