Package java.io

Examples of java.io.InputStream.markSupported()


        InputStream inputStream = is;
        while (true) {
            if (inputStream instanceof ProgressMonitoredInputStream) {
                progressMonitoredIS = (ProgressMonitoredInputStream) inputStream;
            }
            if (inputStream.markSupported()) {
              repeatableInputStream = inputStream;
            }
           
            if (inputStream instanceof InputStreamWrapper) {
                inputStream = ((InputStreamWrapper) inputStream).getWrappedInputStream();
View Full Code Here


        InputStream inputStream = is;
        while (true) {
            if (inputStream instanceof ProgressMonitoredInputStream) {
                progressMonitoredIS = (ProgressMonitoredInputStream) inputStream;
            }
            if (inputStream.markSupported()) {
              repeatableInputStream = inputStream;
            }
           
            if (inputStream instanceof InputStreamWrapper) {
                inputStream = ((InputStreamWrapper) inputStream).getWrappedInputStream();
View Full Code Here

                }
               
                if ( entity != null ) {
                    InputStream content = entity.getContent();
                    if ( retryCount > 0 ) {
                      if ( content.markSupported() ) {
                          content.reset();
                        content.mark(-1);
                      }
                    } else {
                      if ( content.markSupported() ) {
View Full Code Here

                      if ( content.markSupported() ) {
                          content.reset();
                        content.mark(-1);
                      }
                    } else {
                      if ( content.markSupported() ) {
                        content.mark(-1);
                      }
                    }
                }
View Full Code Here

            if (content instanceof StringInputStream) {
                return (StringInputStream)content;
            }

            if (!content.markSupported()) {
                throw new AmazonClientException("Unable to read request payload to sign request.");
            }

            return request.getContent();
        } catch (Exception e) {
View Full Code Here

        if (progressListener != null) {
            input = new ProgressReportingInputStream(input, progressListener);
            fireProgressEvent(progressListener, ProgressEvent.STARTED_EVENT_CODE);
        }

        if (!input.markSupported()) {
            int streamBufferSize = Constants.DEFAULT_STREAM_BUFFER_SIZE;
            String bufferSizeOverride = System.getProperty("com.amazonaws.sdk.s3.defaultStreamBufferSize");
            if (bufferSizeOverride != null) {
                try {
                    streamBufferSize = Integer.parseInt(bufferSizeOverride);
View Full Code Here

        while (requestFactory.hasMoreRequests()) {
            if (threadPool.isShutdown()) throw new CancellationException("TransferManager has been shutdown");
            UploadPartRequest uploadPartRequest = requestFactory.getNextUploadPartRequest();
            // Mark the stream in case we need to reset it
            InputStream inputStream = uploadPartRequest.getInputStream();
            if (inputStream != null && inputStream.markSupported()) {
                if (uploadPartRequest.getPartSize() >= Integer.MAX_VALUE) {
                    inputStream.mark(Integer.MAX_VALUE);
                } else {
                    inputStream.mark((int)uploadPartRequest.getPartSize());
                }
View Full Code Here

                }

                if ( entity != null ) {
                    InputStream content = entity.getContent();
                    if ( requestCount > 1 ) {   // retry
                        if ( content.markSupported() ) {
                            content.reset();
                            content.mark(-1);
                        }
                    } else {
                        if ( content.markSupported() ) {
View Full Code Here

                        if ( content.markSupported() ) {
                            content.reset();
                            content.mark(-1);
                        }
                    } else {
                        if ( content.markSupported() ) {
                            content.mark(-1);
                        }
                    }
                }
View Full Code Here

    private static InputStream getInputStream(final Response response) throws IOException, ExecutionException, InterruptedException {
        if(!response.hasResponseBody()) {
            return new ByteArrayInputStream(new byte[0]);
        } else {
            final InputStream i = response.getResponseBodyAsStream();
            if(i.markSupported())
                return i;
            return new BufferedInputStream(i, ReaderWriter.BUFFER_SIZE);
        }
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.