In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly explains "what is blob in the front end of web". The content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "what is blob in the front end of web".
In general Web development, Blob is rarely used, but Blob can meet the special needs of some scenarios. An abbreviation for Blob,BinaryLargeObject, which represents a large object of binary type. The concept of Blob is used in some databases. For example, the BLOB type in MYSQL represents a container for binary data. In Web, an object of type Blob represents immutable raw data similar to a file object. In popular terms, a Blob object is binary data, but it is binary data similar to a file object, so you can manipulate a Blob object like a File object. In fact, File inherits from Blob.
Basic usage of Blob
Create
You can create a Blob object through the constructor of Blob:
Blob (blobParts [, options])
Blob parameter description:
BlobParts: array type in which each item in the array is joined together to form the data of the Blob object, and each element in the array can be an ArrayBuffer,ArrayBufferView,Blob,DOMString.
Options: optional, dictionary format type, you can specify the following two attributes:
Type, which defaults to "", represents the MIME type of the contents of the array that will be put into blob.
Endings, which defaults to "transparent", is used to specify how the string containing the line Terminator\ nis written. It is one of two values: "native", which means that the line Terminator will be changed to a newline character that is appropriate for the host operating system file system, and "transparent", which means that the Terminator saved in blob will be left unchanged.
Size represents the number of bytes of data contained in the Blob object. Note here that the difference between creating Blob using strings and normal objects is that blob4 uses JSON.stringify to convert data4 objects into json strings, while blob5 is created directly using data4, with size of 14 and 15, respectively. The size of blob4 equals 14 is easy to understand because the result of JSON.stringify (data4) is: "{" name ":" abc "}", which is exactly 14 bytes (excluding the outermost quotation marks). How is the size equal to 15 of blob5 calculated? In fact, when you create a Blob object with a normal object, you call the toString () method of the normal object to get the string data, and then create the Blob object. So, the data saved by blob5 is "[objectObject]", which is 15 bytes (excluding the outermost quotation marks).
Thank you for reading, the above is the content of "what is blob in the front end of web", after the study of this article, I believe you have a deeper understanding of what blob is in the front end of web, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.