@Test public void test10() throws IOException { String cssFile = sourceFolder + "css10.css"; String cmpFile = sourceFolder + "cmp_css10.css"; CssStyleSheet styleSheet = CssStyleSheetParser.parse(new FileInputStream(cssFile)); Assert.assertEquals(getCssFileContents(cmpFile), styleSheet.toString()); }
public static CssStyleSheet parse(InputStream stream, String baseUrl) throws IOException { CssParserStateController controller = new CssParserStateController(baseUrl); Reader br = PortUtil.wrapInBufferedReader(new InputStreamReader(stream, StandardCharsets.UTF_8)); char[] buffer = new char[8192]; int length; while ((length = br.read(buffer, 0, buffer.length)) > 0) { for(int i = 0 ; i < length; i++) { controller.process(buffer[i]); } } return controller.getParsingResult(); }
CssStyleSheetParser { public static CssStyleSheet parse(InputStream stream, String baseUrl) throws IOException { CssParserStateController controller = new CssParserStateController(baseUrl); Reader br = PortUtil.wrapInBufferedReader(new InputStreamReader(stream, StandardCharsets.UTF_8)); char[] buffer = new char[8192]; int length; while ((length = br.read(buffer, 0, buffer.length)) > 0) { for(int i = 0 ; i < length; i++) { controller.process(buffer[i]); } } return controller.getParsingResult(); } }
CssStyleSheetParser { public static CssStyleSheet parse(InputStream stream, String baseUrl) throws IOException { CssParserStateController controller = new CssParserStateController(baseUrl); Reader br = PortUtil.wrapInBufferedReader(new InputStreamReader(stream, StandardCharsets.UTF_8)); char[] buffer = new char[8192]; int length; while ((length = br.read(buffer, 0, buffer.length)) > 0) { for(int i = 0 ; i < length; i++) { controller.process(buffer[i]); } } return controller.getParsingResult(); } private  CssStyleSheetParser(); }
CssStyleSheetParser { public static CssStyleSheet parse(InputStream stream, String baseUrl) throws IOException { CssParserStateController controller = new CssParserStateController(baseUrl); Reader br = PortUtil.wrapInBufferedReader(new InputStreamReader(stream, StandardCharsets.UTF_8)); char[] buffer = new char[8192]; int length; while ((length = br.read(buffer, 0, buffer.length)) > 0) { for(int i = 0 ; i < length; i++) { controller.process(buffer[i]); } } return controller.getParsingResult(); } private  CssStyleSheetParser(); static CssStyleSheet parse(InputStream stream, String baseUrl); static CssStyleSheet parse(InputStream stream); static CssStyleSheet parse(String data, String baseUrl); static CssStyleSheet parse(String data); }
CssStyleSheetParser { public static CssStyleSheet parse(InputStream stream, String baseUrl) throws IOException { CssParserStateController controller = new CssParserStateController(baseUrl); Reader br = PortUtil.wrapInBufferedReader(new InputStreamReader(stream, StandardCharsets.UTF_8)); char[] buffer = new char[8192]; int length; while ((length = br.read(buffer, 0, buffer.length)) > 0) { for(int i = 0 ; i < length; i++) { controller.process(buffer[i]); } } return controller.getParsingResult(); } private  CssStyleSheetParser(); static CssStyleSheet parse(InputStream stream, String baseUrl); static CssStyleSheet parse(InputStream stream); static CssStyleSheet parse(String data, String baseUrl); static CssStyleSheet parse(String data);  }