About scenarios for resource bundle storage resource path names

Source: Internet
Author: User

Resource bundles generally do not directly store the path name of the resource file, but rather hash the pathname, storing its hash-id (in order to avoid the hash conflict, it is best to do two hash, with two hash unique tag a resource file).

This not only makes the query faster, but also avoids the problem that the length of the file record structure (Entry) is not uniform due to the longer path name of the resource file.

However, if there is a need to store the path name of the resource file, you can actually find a way to implement the record resource file path name without affecting the resource bundle file entry (Entry) record structure.

Specific practices:

Take Hash-id as the system occupancy ID of 0, this hash-id is used to store a system file Systemfile (this file is to record all resource path names).

This file records all file paths that are added to the resource bundle, and then the resource file entry (Entry) in the resource bundle records the offset and length of its file path name in the system file (systemfile) separately.

Finally, this system file is added to the resource bundle like any other file, keeping in mind that its hash-id is 0.

This method adds a record to the pathname and does not alter the resource bundle much.

About scenarios for resource bundle storage resource path names

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.