Class Blob (5.0.3)
Stay organized with collections
Save and categorize content based on your preferences.
public final class Blob implements Serializable
Blob contains an array of bytes. This byte array can be no bigger than 1MB. To store
files, particularly files larger than this 1MB limit, look at the Blobstore API.
Constructors
Blob(byte[] bytes)
public Blob(byte[] bytes)
Construct a new Blob with the specified bytes. Since Blobs can be quite large
we do not perform a defensive copy of the provided byte array. It is the programmer's
responsibility to avoid making changes to this array once the Blob has been
constructed.
| Parameter |
| Name |
Description |
bytes |
byte[]
|
Methods
equals(@Nullable Object object)
public boolean equals(@Nullable Object object)
Two Blob objects are considered equal if their contained bytes match exactly.
Overrides
getBytes()
Return the bytes stored in this Blob.
| Returns |
| Type |
Description |
byte[] |
|
hashCode()
| Returns |
| Type |
Description |
int |
|
Overrides
toString()
Simply prints the number of bytes contained in this Blob.
| Returns |
| Type |
Description |
String |
|
Overrides
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-06-03 UTC.
[null,null,["Last updated 2026-06-03 UTC."],[],[]]