Skip to content

Commit 26995ef

Browse files
committed
Use byte[] instead of stream #281
1 parent 89fd0f6 commit 26995ef

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

grails-app/services/au/org/ala/ecodata/forms/EcpWebService.groovy

+4-1
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,10 @@ class EcpWebService {
627627
responseData = objectMapper.readValue(responseData, Object)
628628
}
629629
} else {
630-
responseData = responseBody.byteStream()
630+
// This is only used for the /document/createThumbnail endpoint. Because the thumbnail is small we
631+
// can get away with reading the entire response into memory. If dealing with large files
632+
// we might have to remove the try with resources and handle the stream manually.
633+
responseData = responseBody.bytes()
631634
}
632635

633636
result.statusCode = result.status = response.code()

0 commit comments

Comments
 (0)