org.apache.axiom.attachments
Interface SizeAwareDataSource

All Superinterfaces:
javax.activation.DataSource
All Known Implementing Classes:
ByteArrayDataSource

public interface SizeAwareDataSource
extends javax.activation.DataSource

Optional extension interface that can be implemented by data sources that support a getSize method. Code working with data sources can use this interface to optimize certain operations. An example is BufferUtils.doesDataHandlerExceedLimit(javax.activation.DataHandler, int).


Method Summary
 long getSize()
          Get the size of the data source.
 
Methods inherited from interface javax.activation.DataSource
getContentType, getInputStream, getName, getOutputStream
 

Method Detail

getSize

long getSize()
Get the size of the data source. Implementations must return the number of bytes that can be read from the input stream returned by DataSource.getInputStream() before reaching the end of the stream.

Returns:
the size of the data source


Copyright © 2004-2011 The Apache Software Foundation. All Rights Reserved.