Class ResourceRegion
- java.lang.Object
- org.springframework.core.io.support.ResourceRegion
public class ResourceRegion extends Object
Region of aResource
implementation, materialized by aposition
within theResource
and a bytecount
for the length of that region.- Since:
- 4.3
- Author:
- Arjen Poutsma
Constructor Summary
Constructors Constructor Description ResourceRegion(Resource resource, long position, long count)
Create a newResourceRegion
from a givenResource
.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
getCount()
Return the byte count of this region in the underlyingResource
.long
getPosition()
Return the start position of this region in the underlyingResource
.Resource
getResource()
Return the underlyingResource
for thisResourceRegion
.
Constructor Detail
ResourceRegion
public ResourceRegion(Resource resource, long position, long count)
Create a newResourceRegion
from a givenResource
. This region of a resource is represented by a startposition
and a bytecount
within the givenResource
.- Parameters:
resource
- a Resourceposition
- the start position of the region in that resourcecount
- the byte count of the region in that resource
Method Detail
getResource
public Resource getResource()
Return the underlyingResource
for thisResourceRegion
.
getPosition
public long getPosition()
Return the start position of this region in the underlyingResource
.