Skip to content

Commit

Permalink
v15.1.1; add XmlUtil.parse(Reader)
Browse files Browse the repository at this point in the history
  • Loading branch information
xzel23 committed Jan 10, 2025
1 parent 7ecb27c commit 8da2d33
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,10 @@ the parameter.
## Changes
### 15.1.1
- add XmlUtil.parse(Reader)
### 15.1.0
- TextUtil.base64Decode() allows whitespace and linebreaks
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import org.gradle.internal.extensions.stdlib.toDefaultLowerCase

// define project name and version
rootProject.name = "dua3-utility"
val projectVersion = "15.1.0"
val projectVersion = "15.1.1"

// define subprojects
include("utility")
Expand Down
12 changes: 12 additions & 0 deletions utility/src/main/java/com/dua3/utility/xml/XmlUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,18 @@ public Document parse(InputStream in) throws IOException, SAXException {
return documentBuilder().parse(in);
}

/**
* Read XML from an {@link InputStream} and parse it to {@link Document}.
*
* @param reader the {@link Reader} to read the XML from
* @return the parsed {@link Document}
* @throws IOException in case of an I/O error
* @throws SAXException if an exception is thrown during parsing, i.e. the input is not valid
*/
public Document parse(Reader reader) throws IOException, SAXException {
return documentBuilder().parse(new InputSource(reader));
}

/**
* Parse the content of {@code file} to {@link Document}.
*
Expand Down

0 comments on commit 8da2d33

Please sign in to comment.