List of usage examples for com.amazonaws.services.s3.model GetObjectRequest withRange
public GetObjectRequest withRange(long start, long end)
Sets the optional inclusive byte range within the desired object that will be downloaded by this request.
From source file:core.connector.s3.sync.S3Connector.java
License:GNU General Public License
@Override public byte[] get(String path, long size) throws ConnectorException { try {//from w ww . j a va 2 s.com GetObjectRequest request = new GetObjectRequest(info.getBucketName(), path); if (size >= 0) request.withRange(0, size); return Streams.readFullyBytes(s3.getObject(request).getObjectContent()); } catch (Exception e) { throw new ConnectorException(e); } }