From b9d2c5c9d1f0c67d10f8ed8b4641e81118924f63 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Mon, 9 Mar 2009 21:03:12 +0100 Subject: [PATCH] Add charset parameter to parse method. --- src/net/pterodactylus/arachne/parser/HtmlEditorKitParser.java | 6 +++--- src/net/pterodactylus/arachne/parser/Parser.java | 9 ++++++++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/net/pterodactylus/arachne/parser/HtmlEditorKitParser.java b/src/net/pterodactylus/arachne/parser/HtmlEditorKitParser.java index 7e9085d..45ba774 100644 --- a/src/net/pterodactylus/arachne/parser/HtmlEditorKitParser.java +++ b/src/net/pterodactylus/arachne/parser/HtmlEditorKitParser.java @@ -17,10 +17,10 @@ public class HtmlEditorKitParser implements Parser { /** * {@inheritdoc} * - * @see net.pterodactylus.arachne.parser.Parser#parse(net.pterodactylus.arachne.parser.ParserListener, - * java.io.InputStream) + * @see net.pterodactylus.arachne.parser.Parser#parse(ParserListener, + * InputStream, String) */ - public void parse(ParserListener parserListener, InputStream inputStream) { + public void parse(ParserListener parserListener, InputStream inputStream, String charset) throws IOException { } } diff --git a/src/net/pterodactylus/arachne/parser/Parser.java b/src/net/pterodactylus/arachne/parser/Parser.java index 28d8706..17b7e9c 100644 --- a/src/net/pterodactylus/arachne/parser/Parser.java +++ b/src/net/pterodactylus/arachne/parser/Parser.java @@ -3,6 +3,7 @@ */ package net.pterodactylus.arachne.parser; +import java.io.IOException; import java.io.InputStream; /** @@ -21,7 +22,13 @@ public interface Parser { * The listener to send events to * @param inputStream * The input stream to parse + * @param charset + * The charset to use for parsing, or null if the + * charset is unknown or the file is “binary” file, i.e. not + * characters are read from it but bytes (e.g. image files) + * @throws IOException + * if an I/O error occurs */ - public void parse(ParserListener parserListener, InputStream inputStream); + public void parse(ParserListener parserListener, InputStream inputStream, String charset) throws IOException; } -- 2.7.4