Android
android.content.res
public class

android.content.res.AssetFileDescriptor

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

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.

Summary

Public Constructors

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

Public Methods

          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

Details

Public Constructors

public AssetFileDescriptor(ParcelFileDescriptor fd, long startOffset, long length)

Create a new AssetFileDescriptor from the given values.

Public Methods

public void close()

Convenience for calling getParcelFileDescriptor().close().

Throws

IOException

public FileDescriptor getFileDescriptor()

Returns the FileDescriptor that can be used to read the data in the file.

public long getLength()

Returns the total number of bytes of this asset entry's data.

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.

public long getStartOffset()

Returns the byte offset where this asset entry's data starts.
Copyright 2007 Google Inc. Build 0.9_r1-98467 - 14 Aug 2008 18:56