File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed
core-java-modules/core-java-string-conversions-4/EBCDIC_to_ASCII Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change 1- import java .io .*;
2- import java .nio .charset .*;
3-
4- public class EbcdicToAsciiExample {
1+ import org .slf4j .Logger ;
2+ import org .slf4j .LoggerFactory ;
3+ import java .io .FileInputStream ;
4+ import java .nio .charset .Charset ;
5+ import java .nio .charset .StandardCharsets ;
56
7+ public class FileConverter {
8+ private static final Logger logger = LoggerFactory .getLogger (FileConverter .class );
9+
610 public static void main (String [] args ) throws Exception {
711 // Step 1: Read raw EBCDIC bytes from file
812 FileInputStream fis = new FileInputStream ("input.ebc" );
@@ -15,7 +19,7 @@ public static void main(String[] args) throws Exception {
1519 // Step 3: Encode Unicode string to ASCII bytes
1620 byte [] asciiData = unicodeText .getBytes (StandardCharsets .US_ASCII );
1721
18- // Step 4: Print final ASCII string
19- System . out . println (new String (asciiData , StandardCharsets .US_ASCII ));
22+ // Step 4: Log final ASCII string
23+ logger . info (new String (asciiData , StandardCharsets .US_ASCII ));
2024 }
2125}
You can’t perform that action at this time.
0 commit comments