Build 1.0_r1(from source)

android.content.res
Class AssetFileDescriptor

java.lang.Object
  extended by android.content.res.AssetFileDescriptor

public class AssetFileDescriptor
extends Object

File descriptor of an entry in the AssetManager. This provides your own opened FileDescriptor that can be used to read the data, as well as the offset and length of that entry's data in the file.


Constructor Summary
AssetFileDescriptor(ParcelFileDescriptor fd, long startOffset, long length)
          Create a new AssetFileDescriptor from the given values.
 
Method Summary
 void close()
          Convenience for calling getParcelFileDescriptor().close().
 FileDescriptor getFileDescriptor()
          Returns the FileDescriptor that can be used to read the data in the file.
 long getLength()
          Returns the total number of bytes of this asset entry's data.
 ParcelFileDescriptor getParcelFileDescriptor()
          The AssetFileDescriptor contains its own ParcelFileDescriptor, which in addition to the normal FileDescriptor object also allows you to close the descriptor when you are done with it.
 long getStartOffset()
          Returns the byte offset where this asset entry's data starts.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AssetFileDescriptor

public AssetFileDescriptor(ParcelFileDescriptor fd,
                           long startOffset,
                           long length)
Create a new AssetFileDescriptor from the given values.

Method Detail

getParcelFileDescriptor

public ParcelFileDescriptor getParcelFileDescriptor()
The AssetFileDescriptor contains its own ParcelFileDescriptor, which in addition to the normal FileDescriptor object also allows you to close the descriptor when you are done with it.


getFileDescriptor

public FileDescriptor getFileDescriptor()
Returns the FileDescriptor that can be used to read the data in the file.


getStartOffset

public long getStartOffset()
Returns the byte offset where this asset entry's data starts.


getLength

public long getLength()
Returns the total number of bytes of this asset entry's data.


close

public void close()
           throws IOException
Convenience for calling getParcelFileDescriptor().close().

Throws:
IOException

Build 1.0_r1(from source)

Please submit a feedback, bug or feature