public final class Blob extends Object implements Serializable
Modifier and Type | Method and Description |
---|---|
InputStream |
asInputStream()
Returns an
InputStream for this blob content. |
ByteBuffer |
asReadOnlyByteBuffer()
Returns a read-only
ByteBuffer for this blob content. |
static Blob |
copyFrom(byte[] bytes) |
static Blob |
copyFrom(ByteBuffer bytes) |
static Blob |
copyFrom(InputStream input) |
void |
copyTo(byte[] target)
Copies bytes into a buffer.
|
void |
copyTo(ByteBuffer target)
Copies bytes into a ByteBuffer.
|
boolean |
equals(Object obj) |
int |
getLength()
Returns the size of this blob.
|
int |
hashCode() |
byte[] |
toByteArray()
Returns a copy as byte array.
|
String |
toString() |
public int getLength()
public byte[] toByteArray()
public ByteBuffer asReadOnlyByteBuffer()
ByteBuffer
for this blob content.public InputStream asInputStream()
InputStream
for this blob content.public void copyTo(ByteBuffer target)
ReadOnlyBufferException
- if the target is read-onlyBufferOverflowException
- if the target's remaining() space is not large enough
to hold the datapublic void copyTo(byte[] target)
IndexOutOfBoundsException
- if an offset or size is negative or too largepublic static Blob copyFrom(byte[] bytes)
public static Blob copyFrom(ByteBuffer bytes)
public static Blob copyFrom(InputStream input) throws IOException
IOException
Copyright © 2019 Google LLC. All rights reserved.