# Class ShortBlob (5.0.3)

    public final class ShortBlob implements Serializable, Comparable<ShortBlob>

`ShortBlob` contains an array of bytes no longer than [DataTypeUtils#MAX_SHORT_BLOB_PROPERTY_LENGTH](https://docs.cloud.google.com/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.datastore.DataTypeUtils#com_google_appengine_api_datastore_DataTypeUtils_MAX_SHORT_BLOB_PROPERTY_LENGTH). Unlike [Blob](https://docs.cloud.google.com/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.datastore.Blob), `ShortBlobs` are
indexed by the datastore and can therefore be filtered and sorted on in queries. If your data is
too large to fit in a `ShortBlob` use [Blob](https://docs.cloud.google.com/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.datastore.Blob) instead.

## Inheritance

[java.lang.Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \> ShortBlob

## Implements

[Serializable](https://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html), [Comparable\<ShortBlob\>](https://docs.oracle.com/javase/8/docs/api/java/lang/Comparable<com/google/appengine/api/datastore/ShortBlob>.html)

## Inherited Members

[Object.clone()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--) [Object.equals(Object)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-) [Object.finalize()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--) [Object.getClass()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--) [Object.hashCode()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--) [Object.notify()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--) [Object.notifyAll()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--) [Object.toString()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--) [Object.wait()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--) [Object.wait(long)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-) [Object.wait(long,int)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-)

## Static Fields

### serialVersionUID

    public static final long serialVersionUID

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

## Constructors

### ShortBlob(byte\[\] bytes)

    public ShortBlob(byte[] bytes)

Construct a new `ShortBlob` with the specified bytes. This blob cannot be modified after
construction.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `bytes` | `byte[]` |

## Methods

### compareTo(ShortBlob other)

    public int compareTo(ShortBlob other)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `other` | `https://docs.cloud.google.com/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.datastore.ShortBlob` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

### equals(@Nullable Object object)

    public boolean equals(@Nullable Object object)

Two `ShortBlob` objects are considered equal if their contained bytes match exactly.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `object` | `https://docs.oracle.com/javase/8/docs/api/java/lang/@org/jspecify/annotations/Nullable Object.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

**Overrides** [Object.equals(Object)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-)

### getBytes()

    public byte[] getBytes()

Return the bytes stored in this `ShortBlob`.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `byte[]` |   |

### hashCode()

    public int hashCode()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

**Overrides** [Object.hashCode()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--)

### toString()

    public String toString()

Simply prints the number of bytes contained in this `ShortBlob`.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

**Overrides** [Object.toString()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--)