Example usage for com.amazonaws.services.s3.internal InputSubstream InputSubstream

List of usage examples for com.amazonaws.services.s3.internal InputSubstream InputSubstream

Introduction

In this page you can find the example usage for com.amazonaws.services.s3.internal InputSubstream InputSubstream.

Prototype

public InputSubstream(InputStream in, long offset, long length, boolean closeSourceStream) 

Source Link

Document

Constructs a new InputSubstream so that when callers start reading from this stream they'll start at the specified offset in the real stream and after they've read the specified length, this stream will look empty.

Usage

From source file:de.kopis.glacier.commands.UploadMultipartArchiveCommand.java

License:Open Source License

private InputSubstream newInputSubstream(File file, long startingPosition, long length) {
    try {//from  www .j av  a2 s.  c o m
        return new InputSubstream(new RepeatableFileInputStream(file), startingPosition, length, true);
    } catch (FileNotFoundException e) {
        throw new AmazonClientException("Unable to find file '" + file.getAbsolutePath() + "'", e);
    }
}