Package org.nuxeo.ecm.core.blob
Class ByteRange
- java.lang.Object
-
- org.nuxeo.ecm.core.blob.ByteRange
-
public class ByteRange extends Object
A byte range.- Since:
- 11.1
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedByteRange(long start, long end)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description InputStreamforStream(InputStream stream)Returns a sub-stream of the given stream to which this byte range has been applied.longgetEnd()The end, which is INCLUSIVE.longgetLength()The length.longgetStart()The start.static ByteRangeinclusive(long start, long end)Constructs a byte range from a start and INCLUSIVE end.StringtoString()
-
-
-
Method Detail
-
inclusive
public static ByteRange inclusive(long start, long end)
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
public InputStream forStream(InputStream stream) throws IOException
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
-
-