Category: 5. Binary data, files

  • JavaScript File and FileReader

    Let’s explore File and FileReader in JavaScript. As a rule, a file object inherits from the Blob. It can be extended to filesystem-related facilities. You can obtain it in two ways: The file objects have the same properties as Blob. But, they also have some additional properties such as the name (the file name) and the lastModified(last modification timestamp). Let’s see how the File object…

  • JavaScript Blob

    The browser has additional high-level objects. Among them is the Blob. The Blob object visualizes a blob that is a file-like object of immutable. The Blob is a raw data: you can read it both as binary data or text. It consists of an optional string type, blobParts, strings, as well as BufferSource. Constructing a Blob For constructing a Blob from other data and non-blob objects, the Blob() constructor…

  • JavaScript TextDecoder and TextEncoder

    In this chapter, we are going to explore TextEncoder and TextDecoder in JavaScript. Imagine that the binary data is a string. For example, getting a file with a textual data. With the help of a built-in TextDecoder object, it is possible to read the value into a JavaScript actual string, with the encoding and the buffer. First of all,…

  • JavaScript ArrayBuffer, Binary Arrays

    In web-development, binary data is generally used while working with files ( for instance, creating, uploading, downloading). JavaScript allows doing it all. Multiple classes exist, among them are: In JavaScript, binary data is performed in a non-standard way. But, it becomes simple after getting into some details. ArrayBuffer ArrayBuffer is known as the basic binary object. It is…