/ Sams Teach Yourself C in 21 Days (6th Edition)
/ STYC216E.ISO / mac / Examples / Day27 / reading.java ![]() | < prev | next > |
MacBinary | 2002-05-26 | 1.1 KB | [TEXT/LMAN] |
Confidence | Program | Detection | Match Type | Support |
---|---|---|---|---|
10% | dexvert | MacBinary (archive/macBinary) | fallback | Supported |
1% | dexvert | Text File (text/txt) | fallback | Supported |
100% | file | MacBinary II, Sun May 26 12:04:40 2002, modified Sun May 26 12:04:40 2002, creator 'LMAN', type ASCII, 573 bytes "reading.java" , at 0x2bd 286 bytes resource | default (weak) | |
99% | file | data | default | |
74% | TrID | Macintosh plain text (MacBinary) | default | |
25% | TrID | MacBinary 2 | default (weak) | |
100% | siegfried | fmt/1762 MacBinary (II) | default | |
100% | lsar | MacBinary | default |
id metadata | |
---|---|
key | value |
macFileType | [TEXT] |
macFileCreator | [LMAN] |
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 0c 72 65 61 64 69 6e | 67 2e 6a 61 76 61 00 00 |..readin|g.java..|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4c 4d 41 | 4e 00 00 ff ff ff ff 00 |.TEXTLMA|N.......|
|00000050| 00 00 00 00 00 02 3d 00 | 00 01 1e b9 16 b8 18 b9 |......=.|........|
|00000060| 16 b8 18 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 dc 48 00 00 |........|.....H..|
|00000080| 69 6d 70 6f 72 74 20 6a | 61 76 61 2e 69 6f 2e 2a |import j|ava.io.*|
|00000090| 3b 0d 0a 70 75 62 6c 69 | 63 20 63 6c 61 73 73 20 |;..publi|c class |
|000000a0| 52 65 61 64 54 65 78 74 | 46 69 6c 65 20 7b 0d 0a |ReadText|File {..|
|000000b0| 20 20 70 75 62 6c 69 63 | 20 73 74 61 74 69 63 20 | public| static |
|000000c0| 76 6f 69 64 20 6d 61 69 | 6e 28 53 74 72 69 6e 67 |void mai|n(String|
|000000d0| 20 61 72 67 73 5b 5d 29 | 20 7b 0d 0a 20 20 20 20 | args[])| {.. |
|000000e0| 53 74 72 69 6e 67 20 73 | 3b 0d 0a 20 20 20 20 74 |String s|;.. t|
|000000f0| 72 79 20 7b 0d 0a 20 20 | 20 20 20 20 46 69 6c 65 |ry {.. | File|
|00000100| 52 65 61 64 65 72 20 69 | 6e 46 69 6c 65 20 3d 20 |Reader i|nFile = |
|00000110| 6e 65 77 20 46 69 6c 65 | 52 65 61 64 65 72 28 22 |new File|Reader("|
|00000120| 63 3a 5c 5c 74 65 73 74 | 2e 74 78 74 22 29 3b 0d |c:\\test|.txt");.|
|00000130| 0a 20 20 20 20 20 20 42 | 75 66 66 65 72 65 64 52 |. B|ufferedR|
|00000140| 65 61 64 65 72 20 62 75 | 66 66 20 3d 20 6e 65 77 |eader bu|ff = new|
|00000150| 20 42 75 66 66 65 72 65 | 64 52 65 61 64 65 72 28 | Buffere|dReader(|
|00000160| 69 6e 46 69 6c 65 29 3b | 0d 0a 20 20 20 20 20 20 |inFile);|.. |
|00000170| 62 6f 6f 6c 65 61 6e 20 | 65 6e 64 4f 66 46 69 6c |boolean |endOfFil|
|00000180| 65 20 3d 20 66 61 6c 73 | 65 3b 0d 0a 20 20 20 20 |e = fals|e;.. |
|00000190| 20 20 77 68 69 6c 65 20 | 28 21 65 6e 64 4f 66 46 | while |(!endOfF|
|000001a0| 69 6c 65 29 20 7b 0d 0a | 20 20 20 20 20 20 20 20 |ile) {..| |
|000001b0| 73 20 3d 20 62 75 66 66 | 2e 72 65 61 64 4c 69 6e |s = buff|.readLin|
|000001c0| 65 28 29 3b 0d 0a 20 20 | 20 20 20 20 20 20 69 66 |e();.. | if|
|000001d0| 20 28 73 20 3d 3d 20 6e | 75 6c 6c 29 0d 0a 20 20 | (s == n|ull).. |
|000001e0| 20 20 20 20 20 20 20 20 | 65 6e 64 4f 66 46 69 6c | |endOfFil|
|000001f0| 65 20 3d 20 74 72 75 65 | 3b 0d 0a 20 20 20 20 20 |e = true|;.. |
|00000200| 20 20 20 65 6c 73 65 0d | 0a 20 20 20 20 20 20 20 | else.|. |
|00000210| 20 20 20 53 79 73 74 65 | 6d 2e 6f 75 74 2e 70 72 | Syste|m.out.pr|
|00000220| 69 6e 74 6c 6e 28 73 29 | 3b 0d 0a 20 20 20 20 20 |intln(s)|;.. |
|00000230| 20 7d 0d 0a 20 20 20 20 | 20 20 62 75 66 66 2e 63 | }.. | buff.c|
|00000240| 6c 6f 73 65 28 29 3b 0d | 0a 20 20 20 20 7d 0d 0a |lose();.|. }..|
|00000250| 20 20 20 20 63 61 74 63 | 68 20 28 49 4f 45 78 63 | catc|h (IOExc|
|00000260| 65 70 74 69 6f 6e 20 65 | 29 20 7b 0d 0a 20 20 20 |eption e|) {.. |
|00000270| 20 20 20 53 79 73 74 65 | 6d 2e 6f 75 74 2e 70 72 | Syste|m.out.pr|
|00000280| 69 6e 74 6c 6e 28 22 41 | 6e 20 65 72 72 6f 72 20 |intln("A|n error |
|00000290| 6f 63 63 75 72 72 65 64 | 3a 20 22 20 2b 20 65 2e |occurred|: " + e.|
|000002a0| 74 6f 53 74 72 69 6e 67 | 28 29 29 3b 0d 0a 20 20 |toString|());.. |
|000002b0| 20 20 7d 0d 0a 20 20 7d | 0d 0a 7d 0d 0a 00 00 00 | }.. }|..}.....|
|000002c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000300| 00 00 01 00 00 00 01 00 | 00 00 00 00 00 00 00 1e |........|........|
|00000310| 54 68 69 73 20 72 65 73 | 6f 75 72 63 65 20 66 6f |This res|ource fo|
|00000320| 72 6b 20 69 6e 74 65 6e | 74 69 6f 6e 61 6c 6c 79 |rk inten|tionally|
|00000330| 20 6c 65 66 74 20 62 6c | 61 6e 6b 20 20 20 00 00 | left bl|ank ..|
|00000340| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000350| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000360| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000370| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000380| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000390| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000400| 00 00 01 00 00 00 01 00 | 00 00 00 00 00 00 00 1e |........|........|
|00000410| 00 00 00 00 00 00 00 00 | 00 1c 00 1e ff ff 00 00 |........|........|
|00000420| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000430| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000440| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000450| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000460| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000470| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+