- September 13, 2019 at 7:42 am #62738September 13, 2019 at 7:58 am #62739Nikita #1
Blob is a collection of binary data stored as a single object. You can convert this data type to String or from String using the toString and valueOf methods, respectively. Blobs can be accepted as Web service arguments, stored in a document (the body of a document is a Blob), or sent as attachments.September 13, 2019 at 10:24 am #62759Saddam #6
A blob is data type which collection of binary data, now if i will you I world definitely want to know what is binary data, so you may aware that information in computer is stored in the form of 0 or 1, so to construct a message in particular format whether it’s image or PDF file, it will be store in the form of series of binary data and that form or collection is known as blob.
Blob is part of System namespace which provide methods and classes for apex core functionality, so we have separate blob class, which include some functions that help us to deal with multimedia in salesforce, i.e PDF . Let see all the methods that blob class provide us,
Blob is mainly use in apex to deal with creating PDF files or strings, it doesn’t used to deal with other multimedia objects like images and music, we have a function which valueOf which convert the convert/cast the string into blob object, as we are casting the string into blob the return type of it will be of blob type, see example below.
String testString=’test string’;
Blob myBlob=blob.valueOf(testString);September 13, 2019 at 10:42 am #62761Ashutosh #19
The Blob is a collection of Binary data which is stored as object. This will be used when we want to store the attachment in salesforce into a variable. This data type converts the attachments into a single object. If the blob is to be converted into a string, then we can make use of the toString and the valueOf methods for the same
Contains methods for the Blob primitive data type
Returns the number of characters in the Blob.
Creates a binary object out of the given string, encoding it as a PDF file.
Casts the Blob into a String.
Casts the specified String to a Blob.
Please Register to reply to this topic. /