public class Range extends Object implements HeaderOption
Modifier and Type | Field and Description |
---|---|
protected long |
length |
protected long |
offset |
Modifier and Type | Method and Description |
---|---|
static Range |
first(long maxBytes)
Return only bytes starting from 0 to
maxBytes of data |
static Range |
from(long offset,
long lastByte)
Return bytes only from
offset in bytes to the specified lastByte |
static Range |
last(long lastBytes)
Return only the last N bytes of data
|
static Range |
startAt(long offset)
Return all bytes after the specified
offset of data |
HeaderNameValue |
toHeader()
Transform the option into a Header
|
String |
value() |
public static Range last(long lastBytes)
lastBytes
- the last N bytes to returnpublic static Range first(long maxBytes)
maxBytes
of datamaxBytes
- the max bytes to downloadpublic static Range startAt(long offset)
offset
of dataoffset
- the starting pointerpublic static Range from(long offset, long lastByte)
offset
in bytes to the specified lastByte
offset
- the starting pointerlastByte
- the last bytepublic HeaderNameValue toHeader()
HeaderOption
toHeader
in interface HeaderOption
public String value()
Copyright © 2017. All rights reserved.