Use StringBuilder instead of StringBuffer.
Use final.
MODIFY
src/main/java/org/apache/commons/io/input/XmlStreamReader.java
src/main/java/org/apache/commons/io/input/XmlStreamReader.java
@@ -214,7 +214,7 @@ private static String getXmlProlog(final InputStream inputStream, final String g
inputStream.reset();
final BufferedReader bReader = new BufferedReader(new StringReader(
xmlProlog.substring(0, firstGT + 1)));
- final StringBuffer prolog = new StringBuffer();
+ final StringBuilder prolog = new StringBuilder();
String line;
while ((line = bReader.readLine()) != null) {
prolog.append(line);

MODIFY
src/test/java/org/apache/commons/io/input/compatibility/XmlStreamReader.java
src/test/java/org/apache/commons/io/input/compatibility/XmlStreamReader.java
@@ -689,7 +689,7 @@ private static String getXmlProlog(final BufferedInputStream is, final String gu
is.reset();
final BufferedReader bReader = new BufferedReader(new StringReader(
xmlProlog.substring(0, firstGT + 1)));
- final StringBuffer prolog = new StringBuffer();
+ final StringBuilder prolog = new StringBuilder();
String line;
while ((line = bReader.readLine()) != null) {
prolog.append(line);

Use StringBuilder instead of StringBuffer.

Use final.