Class Range
- java.lang.Object
-
- org.openstack4j.model.common.header.Range
-
- All Implemented Interfaces:
HeaderOption
public class Range extends Object implements HeaderOption
A Range is used to get portions of data by using one or more range specifications.- Author:
- Jeremy Unruh
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Rangefirst(long maxBytes)Return only bytes starting from 0 tomaxBytesof datastatic Rangefrom(long offset, long lastByte)Return bytes only fromoffsetin bytes to the specifiedlastBytestatic Rangelast(long lastBytes)Return only the last N bytes of datastatic RangestartAt(long offset)Return all bytes after the specifiedoffsetof dataHeaderNameValuetoHeader()Transform the option into a HeaderStringvalue()
-
-
-
Method Detail
-
last
public static Range last(long lastBytes)
Return only the last N bytes of data- Parameters:
lastBytes- the last N bytes to return- Returns:
- the range object
-
first
public static Range first(long maxBytes)
Return only bytes starting from 0 tomaxBytesof data- Parameters:
maxBytes- the max bytes to download- Returns:
- the range object
-
startAt
public static Range startAt(long offset)
Return all bytes after the specifiedoffsetof data- Parameters:
offset- the starting pointer- Returns:
- the range object
-
from
public static Range from(long offset, long lastByte)
Return bytes only fromoffsetin bytes to the specifiedlastByte- Parameters:
offset- the starting pointerlastByte- the last byte- Returns:
- the range object
-
toHeader
public HeaderNameValue toHeader()
Description copied from interface:HeaderOptionTransform the option into a Header- Specified by:
toHeaderin interfaceHeaderOption- Returns:
- the header name value object
-
value
public String value()
-
-