KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tc > util > io > BlankLineSkippingBufferedReader


1 /**
2  * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
3  */

4 package com.tc.util.io;
5
6 import java.io.BufferedReader JavaDoc;
7 import java.io.IOException JavaDoc;
8 import java.io.Reader JavaDoc;
9
10 public class BlankLineSkippingBufferedReader extends BufferedReader JavaDoc {
11
12   public BlankLineSkippingBufferedReader(Reader JavaDoc in, int sz) {
13     super(in, sz);
14   }
15
16   public BlankLineSkippingBufferedReader(Reader JavaDoc in) {
17     super(in);
18   }
19
20   public String JavaDoc readLine() throws IOException JavaDoc {
21     String JavaDoc out;
22
23     do {
24       out = super.readLine();
25     } while (out != null && out.trim().length() == 0);
26
27     return out;
28   }
29
30 }
31
Popular Tags