Skip to content

Commit d205d8b

Browse files
committed
jphp-httpserver-ext: Fix for java 8
1 parent c18b3c7 commit d205d8b

File tree

1 file changed

+4
-1
lines changed
  • exts/jphp-httpserver-ext/src/main/java/org/develnext/jphp/ext/httpserver/classes

1 file changed

+4
-1
lines changed

exts/jphp-httpserver-ext/src/main/java/org/develnext/jphp/ext/httpserver/classes/PHttpPart.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@ public PHttpPart(Environment env, ClassEntity clazz) {
2424
@Reflection.Signature
2525
public byte[] readAll() throws IOException {
2626
ByteArrayInputStream inputStream = (ByteArrayInputStream) getWrappedObject().getInputStream();
27-
return inputStream.readAllBytes();
27+
byte[] array = new byte[inputStream.available()];
28+
inputStream.read(array);
29+
inputStream.close();
30+
return array;
2831
}
2932

3033
@Reflection.Signature

0 commit comments

Comments
 (0)