com.google.appengine.api.datastore
Class Blob
- java.lang.Object
-
- com.google.appengine.api.datastore.Blob
-
- All Implemented Interfaces:
- java.io.Serializable
public final class Blob extends java.lang.Object implements java.io.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.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description Blob(byte[] bytes)
Construct a newBlob
with the specified bytes.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description boolean
equals(java.lang.Object object)
TwoBlob
objects are considered equal if their contained bytes match exactly.byte[]
getBytes()
Return the bytes stored in thisBlob
.int
hashCode()
java.lang.String
toString()
Simply prints the number of bytes contained in thisBlob
.
-
-
-
Constructor Detail
-
Blob
public Blob(byte[] bytes)
Construct a newBlob
with the specified bytes. SinceBlobs
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 theBlob
has been constructed.
-
-
Method Detail
-
getBytes
public byte[] getBytes()
Return the bytes stored in thisBlob
.
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object object)
TwoBlob
objects are considered equal if their contained bytes match exactly.- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
Simply prints the number of bytes contained in thisBlob
.- Overrides:
toString
in classjava.lang.Object
-
-