Construct MetadataRepo from an input stream. The library does not close the given
InputStream, therefore it is caller's responsibility to properly close the stream.
Parameters
typeface
Typeface: Typeface to be used to render emojis
inputStream
InputStream: InputStream to read emoji metadata from
Construct MetadataRepo from a byte buffer. The position of the ByteBuffer will change, it is
caller's responsibility to reposition the buffer if required.
Parameters
typeface
Typeface: Typeface to be used to render emojis
byteBuffer
ByteBuffer: ByteBuffer to read emoji metadata from
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# MetadataRepo\n\nadded in [version 26.1.0](/topic/libraries/support-library/revisions) \nbelongs to Maven artifact com.android.support:support-emoji:28.0.0-alpha1 \nSummary: [Methods](#pubmethods) \\| [Inherited Methods](#inhmethods) \\| [\\[Expand All\\]](#) \n\nMetadataRepo\n============\n\n| This package is part of the Android [support library](/topic/libraries/support-library) which is no longer maintained. The support library has been superseded by [AndroidX](/jetpack/androidx) which is part of [Jetpack](/jetpack). We recommend using the AndroidX libraries in all new projects. You should also consider [migrating](/jetpack/androidx/migrate) existing projects to AndroidX. To find the AndroidX class that maps to this deprecated class, see the AndroidX support library [class\n| mappings](/jetpack/androidx/migrate/class-mappings).\n\n\n`\npublic\n\nfinal\n\nclass\nMetadataRepo\n`\n\n\n`\n\nextends Object\n\n\n`\n\n`\n\n\n`\n\n|---|-----------------------------------------|\n| java.lang.Object ||\n| ↳ | android.support.text.emoji.MetadataRepo |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nClass to hold the emoji metadata required to process and draw emojis.\n\nSummary\n-------\n\n| ### Public methods ||\n|------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` static `[MetadataRepo](/reference/android/support/text/emoji/MetadataRepo) | ` `[create](/reference/android/support/text/emoji/MetadataRepo#create(android.graphics.Typeface, java.io.InputStream))`(`[Typeface](https://developer.android.com/reference/android/graphics/Typeface.html)` typeface, InputStream inputStream) ` Construct MetadataRepo from an input stream. |\n| ` static `[MetadataRepo](/reference/android/support/text/emoji/MetadataRepo) | ` `[create](/reference/android/support/text/emoji/MetadataRepo#create(android.graphics.Typeface, java.nio.ByteBuffer))`(`[Typeface](https://developer.android.com/reference/android/graphics/Typeface.html)` typeface, ByteBuffer byteBuffer) ` Construct MetadataRepo from a byte buffer. |\n| ` static `[MetadataRepo](/reference/android/support/text/emoji/MetadataRepo) | ` `[create](/reference/android/support/text/emoji/MetadataRepo#create(android.content.res.AssetManager, java.lang.String))`(`[AssetManager](https://developer.android.com/reference/android/content/res/AssetManager.html)` assetManager, String assetPath) ` Construct MetadataRepo from an asset. |\n\n| ### Inherited methods |\n|-----------------------|---|\n| From class ` java.lang.Object ` |-------------------|-------------------------------| | ` Object` | ` clone() ` | | ` boolean` | ` equals(Object arg0) ` | | ` void` | ` finalize() ` | | ` final Class\u003c?\u003e` | ` getClass() ` | | ` int` | ` hashCode() ` | | ` final void` | ` notify() ` | | ` final void` | ` notifyAll() ` | | ` String` | ` toString() ` | | ` final void` | ` wait(long arg0, int arg1) ` | | ` final void` | ` wait(long arg0) ` | | ` final void` | ` wait() ` | ||\n\nPublic methods\n--------------\n\n### create\n\nadded in [version 26.1.0](/topic/libraries/support-library/revisions) \n\n```\nMetadataRepo create (Typeface typeface, \n InputStream inputStream)\n```\n\nConstruct MetadataRepo from an input stream. The library does not close the given\nInputStream, therefore it is caller's responsibility to properly close the stream.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|---------------|---------------------------------------------------------------|\n| `typeface` | `Typeface`: Typeface to be used to render emojis \u003cbr /\u003e |\n| `inputStream` | `InputStream`: InputStream to read emoji metadata from \u003cbr /\u003e |\n\n| Returns ||\n|--------------------------------------------------------------------|--------|\n| [MetadataRepo](/reference/android/support/text/emoji/MetadataRepo) | \u003cbr /\u003e |\n\n| Throws ||\n|---------------|---|\n| `IOException` | |\n\n### create\n\nadded in [version 26.1.0](/topic/libraries/support-library/revisions) \n\n```\nMetadataRepo create (Typeface typeface, \n ByteBuffer byteBuffer)\n```\n\nConstruct MetadataRepo from a byte buffer. The position of the ByteBuffer will change, it is\ncaller's responsibility to reposition the buffer if required.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|--------------|-------------------------------------------------------------|\n| `typeface` | `Typeface`: Typeface to be used to render emojis \u003cbr /\u003e |\n| `byteBuffer` | `ByteBuffer`: ByteBuffer to read emoji metadata from \u003cbr /\u003e |\n\n| Returns ||\n|--------------------------------------------------------------------|--------|\n| [MetadataRepo](/reference/android/support/text/emoji/MetadataRepo) | \u003cbr /\u003e |\n\n| Throws ||\n|---------------|---|\n| `IOException` | |\n\n### create\n\nadded in [version 26.1.0](/topic/libraries/support-library/revisions) \n\n```\nMetadataRepo create (AssetManager assetManager, \n String assetPath)\n```\n\nConstruct MetadataRepo from an asset.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|----------------|-----------------------------------------------------------------------------------------------------|\n| `assetManager` | `AssetManager`: AssetManager instance \u003cbr /\u003e |\n| `assetPath` | `String`: asset manager path of the file that the Typeface and metadata will be created from \u003cbr /\u003e |\n\n| Returns ||\n|--------------------------------------------------------------------|--------|\n| [MetadataRepo](/reference/android/support/text/emoji/MetadataRepo) | \u003cbr /\u003e |\n\n| Throws ||\n|---------------|---|\n| `IOException` | |\n\n-\n\n Interfaces\n ----------\n\n - [EmojiCompat.MetadataRepoLoader](/reference/android/support/text/emoji/EmojiCompat.MetadataRepoLoader)\n-\n\n Classes\n -------\n\n - [EmojiCompat](/reference/android/support/text/emoji/EmojiCompat)\n - [EmojiCompat.Config](/reference/android/support/text/emoji/EmojiCompat.Config)\n - [EmojiCompat.InitCallback](/reference/android/support/text/emoji/EmojiCompat.InitCallback)\n - [EmojiCompat.MetadataRepoLoaderCallback](/reference/android/support/text/emoji/EmojiCompat.MetadataRepoLoaderCallback)\n - [EmojiSpan](/reference/android/support/text/emoji/EmojiSpan)\n - [FontRequestEmojiCompatConfig](/reference/android/support/text/emoji/FontRequestEmojiCompatConfig)\n - [FontRequestEmojiCompatConfig.ExponentialBackoffRetryPolicy](/reference/android/support/text/emoji/FontRequestEmojiCompatConfig.ExponentialBackoffRetryPolicy)\n - [FontRequestEmojiCompatConfig.RetryPolicy](/reference/android/support/text/emoji/FontRequestEmojiCompatConfig.RetryPolicy)\n - [MetadataRepo](/reference/android/support/text/emoji/MetadataRepo)\n - [R](/reference/android/support/text/emoji/R)\n - [R.attr](/reference/android/support/text/emoji/R.attr)\n - [R.bool](/reference/android/support/text/emoji/R.bool)\n - [R.color](/reference/android/support/text/emoji/R.color)\n - [R.dimen](/reference/android/support/text/emoji/R.dimen)\n - [R.drawable](/reference/android/support/text/emoji/R.drawable)\n - [R.id](/reference/android/support/text/emoji/R.id)\n - [R.integer](/reference/android/support/text/emoji/R.integer)\n - [R.layout](/reference/android/support/text/emoji/R.layout)\n - [R.string](/reference/android/support/text/emoji/R.string)\n - [R.style](/reference/android/support/text/emoji/R.style)\n - [R.styleable](/reference/android/support/text/emoji/R.styleable)"]]