Top Description Fields Constructors Methods
org.springframework.core.io.support

public Class ResourceRegion

extends Object
Class Inheritance
Imports
org.springframework.core.io.Resource, org.springframework.util.Assert

Region of a Resource implementation, materialized by a position within the Resource and a byte count for the length of that region.
Author
Arjen Poutsma
Since
4.3

Field Summary

Modifier and TypeField and Description
private final long
private final long
private final Resource

Constructor Summary

AccessConstructor and Description
public
ResourceRegion(Resource
a Resource
resource
,
long
the start position of the region in that resource
position
,
long
the byte count of the region in that resource
count
)

Create a new ResourceRegion from a given Resource.

Method Summary

Modifier and TypeMethod and Description
public long
getCount()

Return the byte count of this region in the underlying Resource.

public long
getPosition()

Return the start position of this region in the underlying Resource.

public Resource
getResource()

Return the underlying Resource for this ResourceRegion.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

countback to summary
private final long count
positionback to summary
private final long position
resourceback to summary
private final Resource resource

Constructor Detail

ResourceRegionback to summary
public ResourceRegion(Resource resource, long position, long count)

Create a new ResourceRegion from a given Resource. This region of a resource is represented by a start position and a byte count within the given Resource.

Parameters
resource:Resource

a Resource

position:long

the start position of the region in that resource

count:long

the byte count of the region in that resource

Method Detail

getCountback to summary
public long getCount()

Return the byte count of this region in the underlying Resource.

getPositionback to summary
public long getPosition()

Return the start position of this region in the underlying Resource.

getResourceback to summary
public Resource getResource()

Return the underlying Resource for this ResourceRegion.