Skip to content
This repository was archived by the owner on Jun 2, 2023. It is now read-only.

Commit eb7c76f

Browse files
authored
Merge pull request #169 from WASdev/fixIndexHtml
Fix to stop extra bytes being written to end of index.html
2 parents fed3a64 + 435ce2a commit eb7c76f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

liberty-starter-application/src/main/java/com/ibm/liberty/starter/ProjectConstructor.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,12 +191,13 @@ public byte[] getHtmlFile() throws IOException {
191191
final int MAX_SIZE = 200000;
192192
char[] buffer = new char[MAX_SIZE];
193193

194+
int len = 0;
194195
try (BufferedReader reader = new BufferedReader(new InputStreamReader(htmlIS));) {
195-
reader.read(buffer, 0, MAX_SIZE);
196+
len = reader.read(buffer, 0, MAX_SIZE);
196197
} catch (Exception e ){
197198
return null;
198199
}
199-
String contents = new String(buffer);
200+
String contents = new String(buffer, 0, len);
200201
int index = contents.indexOf("<div id=\"technologies\">");
201202
if (index != -1) {
202203
int length = contents.length();

0 commit comments

Comments
 (0)