Class Blob (2.14.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
NameDescription
bytesbyte[]
Returns
TypeDescription
Blob

copyFrom(InputStream input)

public static Blob copyFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
Blob
Exceptions
TypeDescription
IOException

copyFrom(ByteBuffer bytes)

public static Blob copyFrom(ByteBuffer bytes)
Parameter
NameDescription
bytesByteBuffer
Returns
TypeDescription
Blob

Methods

asInputStream()

public InputStream asInputStream()

Returns an InputStream for this blob content.

Returns
TypeDescription
InputStream

asReadOnlyByteBuffer()

public ByteBuffer asReadOnlyByteBuffer()

Returns a read-only ByteBuffer for this blob content.

Returns
TypeDescription
ByteBuffer

copyTo(byte[] target)

public void copyTo(byte[] target)

Copies bytes into a buffer.

Parameter
NameDescription
targetbyte[]

copyTo(ByteBuffer target)

public void copyTo(ByteBuffer target)

Copies bytes into a ByteBuffer.

Parameter
NameDescription
targetByteBuffer

equals(Object obj)

public boolean equals(Object obj)
Parameter
NameDescription
objObject
Returns
TypeDescription
boolean
Overrides

getLength()

public int getLength()

Returns the size of this blob.

Returns
TypeDescription
int

hashCode()

public int hashCode()
Returns
TypeDescription
int
Overrides

toByteArray()

public byte[] toByteArray()

Returns a copy as byte array.

Returns
TypeDescription
byte[]

toString()

public String toString()
Returns
TypeDescription
String
Overrides