Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
po:lab6 [2017/11/30 13:25]
pszwed [Do zaimplementowania]
po:lab6 [2018/11/22 13:40]
pszwed [Funkcje getTime i getDate]
Line 247: Line 247:
  
  
 +===== Zestaw znaków =====
  
 +Poniższy kod pokazuje, jak odczytać/zapisać plik wskazując zestaw znaków
  
 +
 +<code java>
 +        try (BufferedReader input = new BufferedReader(new InputStreamReader( new FileInputStream(inname), Charset.forName("Cp1250")))){
 +            try(PrintWriter output = new PrintWriter( new OutputStreamWriter(new FileOutputStream(outname),"Cp1250"))){
 +                for(;;){
 +                    String line = input.readLine();
 +                    if(line==null)break;
 +                    output.println(line);
 +                }
 +            }
 +
 +</code>
po/lab6.txt · Last modified: 2018/11/22 13:40 by pszwed
CC Attribution-Share Alike 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0