X-Git-Url: http://dolda2000.com/gitweb/?a=blobdiff_plain;f=src%2Fdolda%2Fjsvc%2Futil%2FMisc.java;h=9b7f8e184f9ac6cd05832fbf7f7548d5d0dc8290;hb=13e578b10b388cc0dea88e05b79265c21416e3a0;hp=63a10a776d7269293d73f8a75316984fbed8f7ae;hpb=5cdd61df59fc87e9f8dbbfb0f1ea1c535a3694f9;p=jsvc.git diff --git a/src/dolda/jsvc/util/Misc.java b/src/dolda/jsvc/util/Misc.java index 63a10a7..9b7f8e1 100644 --- a/src/dolda/jsvc/util/Misc.java +++ b/src/dolda/jsvc/util/Misc.java @@ -6,6 +6,7 @@ import java.io.*; public class Misc { public static final java.nio.charset.Charset utf8 = java.nio.charset.Charset.forName("UTF-8"); + public static final java.nio.charset.Charset ascii = java.nio.charset.Charset.forName("US-ASCII"); private static Map stext = new HashMap(); static { @@ -131,4 +132,14 @@ public class Misc { return(false); throw(new IllegalArgumentException("value not recognized as boolean: " + val)); } + + public static void eatws(PushbackReader in) throws IOException { + int c; + do { + c = in.read(); + if(c < 0) + return; + } while(Character.isWhitespace(c)); + in.unread(c); + } }