()
| 50 | int state = lastCharNL; |
| 51 | |
| 52 | public int read() throws IOException { |
| 53 | int b; |
| 54 | |
| 55 | if ( state == sentSemi ) { |
| 56 | state = lastCharNL; |
| 57 | return '\n'; |
| 58 | } |
| 59 | |
| 60 | // skip CR |
| 61 | while ( (b = in.read()) == '\r' ); |
| 62 | |
| 63 | if ( b == '\n' ) |
| 64 | if ( state == lastCharNL ) { |
| 65 | b = ';'; |
| 66 | state = sentSemi; |
| 67 | } else |
| 68 | state = lastCharNL; |
| 69 | else |
| 70 | state = normal; |
| 71 | |
| 72 | return b; |
| 73 | } |
| 74 | |
| 75 | /** |
| 76 | This is a degenerate implementation. |
no outgoing calls
no test coverage detected