public interface SizeAwareDataSource
extends javax.activation.DataSource
DataSourceUtils.getSize(DataSource)
because this method is able to determine the size of other types of data sources as well.
Code using this interface should be aware that some implementations may be unable to guarantee 100% accuracy when determining the size of the data source. Situations where this can occur include:
read
methods of the
InputStream
class). It must be prepared to reach the end of the stream after
a number of bytes that is lower or higher than the value returned by getSize()
.Modifier and Type | Method and Description |
---|---|
long |
getSize()
Get the size of the data source.
|
long getSize()
DataSource.getInputStream()
before reaching
the end of the stream. If the implementation is unable to determine the
size, it must return -1.Copyright © 2004-2013 The Apache Software Foundation. All Rights Reserved.