Class Blob (2.20.1)

public final class Blob implements Serializable

A Google Cloud Datastore Blob. This class is immutable. See Also: Google Cloud Datastore Entities, Properties, and Keys

Inheritance

Object > Blob

Implements

Serializable

Static Methods

copyFrom(byte[] bytes)

public static Blob copyFrom(byte[] bytes)
Parameter
Name Description
bytes byte[]
Returns
Type Description
Blob

copyFrom(InputStream input)

public static Blob copyFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
Blob
Exceptions
Type Description
IOException

copyFrom(ByteBuffer bytes)

public static Blob copyFrom(ByteBuffer bytes)
Parameter
Name Description
bytes ByteBuffer
Returns
Type Description
Blob

Methods

asInputStream()

public InputStream asInputStream()

Returns an InputStream for this blob content.

Returns
Type Description
InputStream

asReadOnlyByteBuffer()

public ByteBuffer asReadOnlyByteBuffer()

Returns a read-only ByteBuffer for this blob content.

Returns
Type Description
ByteBuffer

copyTo(byte[] target)

public void copyTo(byte[] target)

Copies bytes into a buffer.

Parameter
Name Description
target byte[]

copyTo(ByteBuffer target)

public void copyTo(ByteBuffer target)

Copies bytes into a ByteBuffer.

Parameter
Name Description
target ByteBuffer

equals(Object obj)

public boolean equals(Object obj)
Parameter
Name Description
obj Object
Returns
Type Description
boolean
Overrides

getLength()

public int getLength()

Returns the size of this blob.

Returns
Type Description
int

hashCode()

public int hashCode()
Returns
Type Description
int
Overrides

toByteArray()

public byte[] toByteArray()

Returns a copy as byte array.

Returns
Type Description
byte[]

toString()

public String toString()
Returns
Type Description
String
Overrides