code: private synchronized void reopen(String reason, long targetPos, long length)
        throws IOException {
  
      if (wrappedStream != null) {
        closeStream("reopen(" + reason + ")", contentRangeFinish, false);
      }
  
      contentRangeFinish = calculateRequestLimit(inputPolicy, targetPos,
          length, contentLength, readahead);
      LOG.debug("reopen({}) for {} range[{}-{}], length={},"
          + " streamPosition={}, nextReadPosition={}",
          uri, reason, targetPos, contentRangeFinish, length,  pos, nextReadPos);
  
      try {
        GetObjectRequest request = new GetObjectRequest(bucket, key)
            .withRange(targetPos, contentRangeFinish - 1);
        wrappedStream = client.getObject(request).getObjectContent();
        contentRangeStart = targetPos;
        if (wrappedStream == null) {
          throw new IOException("Null IO stream from reopen of (" + reason +  ") "
              + uri);
        }
      } catch (AmazonClientException e) {
        throw COSUtils.translateException("Reopen at position " + targetPos, uri, e);
      }
  
      pos = targetPos;
    }
docs: Opens up the stream at specified target position and for given length.
  
  @param reason reason for reopen
  @param targetPos target position
  @param length length requested
  @throws IOException on any failure to open the object