Skip to content

Commit

Permalink
Merge pull request #27059 from geoand/spring-cloud-config-is
Browse files Browse the repository at this point in the history
Replace InputStream bytes with InputStream.readAllBytes in Spring Cloud Config client
geoand authored Aug 1, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
2 parents 5f15130 + 3d22ce5 commit ea4990f
Showing 1 changed file with 1 addition and 9 deletions.
Original file line number Diff line number Diff line change
@@ -2,7 +2,6 @@

import static io.vertx.core.spi.resolver.ResolverProvider.DISABLE_DNS_RESOLVER_PROP_NAME;

import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import java.net.URI;
import java.net.URISyntaxException;
@@ -168,14 +167,7 @@ private static byte[] storeBytes(Path keyStorePath)
}

private static byte[] allBytes(InputStream inputStream) throws Exception {
ByteArrayOutputStream buffer = new ByteArrayOutputStream();
int nRead;
byte[] data = new byte[1024];
while ((nRead = inputStream.read(data, 0, data.length)) != -1) {
buffer.write(data, 0, nRead);
}
buffer.flush();
return buffer.toByteArray();
return inputStream.readAllBytes();
}

private URI determineBaseUri(SpringCloudConfigClientConfig springCloudConfigClientConfig) throws URISyntaxException {

0 comments on commit ea4990f

Please sign in to comment.