Code example for AssetManager: Using file assets

Methods: open

0
	 * This implementation returns whether the underlying asset exists. 
	 */ 
	@Override 
	public boolean exists() { 
		try { 
			InputStream inputStream = this.assetManager.open(this.fileName);
			if (inputStream != null) {
				return true; 
			} else { 
				return false; 
			} 
		} catch (IOException e) {
			return false; 
		} 
	} 
 
	/** 
	 * This implementation checks the length of the underlying AssetFileDescriptor, if available. 
	 * @see android.content.res.AssetFileDescriptor#getLength() 
	 */ 
	public long contentLength() throws IOException {