jclouds-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Gaul <notificati...@github.com>
Subject Re: [jclouds] add aws s3 signature v4 (#678)
Date Tue, 19 May 2015 15:17:45 GMT
> +        ChunkedInputStreamEnumeration(InputStream inputStream, int chunkedBlockSize)
{
> +            this.inputStream = new BufferedInputStream(inputStream, chunkedBlockSize);
> +            buffer = new byte[chunkedBlockSize];
> +            lastChunked = false;
> +        }
> +
> +        @Override
> +        public boolean hasMoreElements() {
> +            return !lastChunked;
> +        }
> +
> +        @Override
> +        public InputStream nextElement() {
> +            int bytesRead;
> +            try {
> +                bytesRead = inputStream.read(buffer, 0, buffer.length);

Can also call `ByteStreams.readFully(InputStream, byte[])`.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/678/files#r30610288
Mime
View raw message