Code example for AssetManager

Methods: openFd

0
	/** 
	 * This implementation checks the length of the underlying AssetFileDescriptor, if available. 
	 * @see android.content.res.AssetFileDescriptor#getLength() 
	 */ 
	public long contentLength() throws IOException { 
		return assetManager.openFd(this.fileName).getLength();
	} 
 
	public String getDescription() {
		return "asset [" + this.fileName + "]";
	} 
 
	public InputStream getInputStream() throws IOException {
		InputStream inputStream = this.assetManager.open(this.fileName);
		if (inputStream == null) {
			throw new FileNotFoundException(getDescription() + " cannot be opened because it does not exist");
		} 
		return inputStream;
	} 
 
	/**