private long readSourceAvailableBytes(HttpURLConnection connection, long offset, int responseCode) throws IOException {
        long contentLength = getContentLength(connection);
        return responseCode == HTTP_OK ? contentLength
                : responseCode == HTTP_PARTIAL ? contentLength + offset : sourceInfo.length;
    }
{@link Source} that uses http resource as source for {@link ProxyCache}.

@author Alexey Danilov (danikula@gmail.com).
dkplayer-videocache/src/main/java/com/danikula/videocache/HttpUrlSource.java