Package org.nuxeo.ecm.core.blob
Class ByteRange
java.lang.Object
org.nuxeo.ecm.core.blob.ByteRange
A byte range.
- Since:
- 11.1
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionforStream
(InputStream stream) Returns a sub-stream of the given stream to which this byte range has been applied.long
getEnd()
The end, which is INCLUSIVE.long
The length.long
getStart()
The start.static ByteRange
inclusive
(long start, long end) Constructs a byte range from a start and INCLUSIVE end.toString()
-
Field Details
-
start
protected final long start -
end
protected final long endThe end is inclusive.
-
-
Constructor Details
-
ByteRange
protected ByteRange(long start, long end)
-
-
Method Details
-
inclusive
Constructs a byte range from a start and INCLUSIVE end.- Parameters:
start
- the startend
- the INCLUSIVE end
-
getStart
public long getStart()The start. -
getEnd
public long getEnd()The end, which is INCLUSIVE. -
getLength
public long getLength()The length. -
forStream
Returns a sub-stream of the given stream to which this byte range has been applied.- Parameters:
stream
- the stream- Returns:
- a sub-stream for this byte range
- Throws:
IOException
-
toString
-