public interface Blob extends Lob
transaction
scope,
to prevent unexpected updates.Clob
Modifier and Type | Method and Description |
---|---|
java.lang.String |
asString()
Convenience method to capture all the Blob data as a single String,
assuming UTF-8 encoding.
|
java.lang.String |
asString(java.nio.charset.Charset charset)
Convenience method to capture all the Blob data as a single String,
decoded against the given charset.
|
java.lang.String |
asString(java.lang.String charsetName)
Convenience method to capture all the Blob data as a single String,
decoded against the given charset.
|
long |
getLength()
Returns the length of this Blob, in bytes.
|
java.io.InputStream |
openInputStream()
Returns an InputStream for reading Blob data positioned at the
start.
|
java.io.InputStream |
openInputStream(long pos)
Returns an InputStream for reading Blob data.
|
java.io.InputStream |
openInputStream(long pos,
int bufferSize)
Returns an InputStream for reading Blob data.
|
java.io.OutputStream |
openOutputStream()
Returns an OutputStream for writing Blob data, positioned at the
start.
|
java.io.OutputStream |
openOutputStream(long pos)
Returns an OutputStream for writing Blob data.
|
java.io.OutputStream |
openOutputStream(long pos,
int bufferSize)
Returns an OutputStream for writing Blob data.
|
void |
setLength(long length)
Set the length of this Blob, in bytes.
|
void |
setValue(java.lang.String value)
Convenience method to overwrite all Blob data with the value of a single
String, applying UTF-8 encoding.
|
void |
setValue(java.lang.String value,
java.nio.charset.Charset charset)
Convenience method to overwrite all Blob data with the value of a single
String, applying the given charset encoding.
|
void |
setValue(java.lang.String value,
java.lang.String charsetName)
Convenience method to overwrite all Blob data with the value of a single
String, applying the given charset encoding.
|
equals, getLocator
java.io.InputStream openInputStream() throws FetchException
java.lang.IllegalArgumentException
- if position is negativeFetchException
java.io.InputStream openInputStream(long pos) throws FetchException
pos
- desired zero-based position to read fromjava.lang.IllegalArgumentException
- if position is negativeFetchException
java.io.InputStream openInputStream(long pos, int bufferSize) throws FetchException
pos
- desired zero-based position to read frombufferSize
- suggest that the input stream buffer be at least this large (in bytes)java.lang.IllegalArgumentException
- if position is negativeFetchException
long getLength() throws FetchException
FetchException
java.lang.String asString() throws FetchException
java.lang.IllegalArgumentException
- if resulting String length would be
greater than Integer.MAX_VALUEjava.lang.OutOfMemoryError
- if not enough memory to hold Blob as a single StringFetchException
java.lang.String asString(java.lang.String charsetName) throws FetchException
charsetName
- name of character set to decode Stringjava.nio.charset.IllegalCharsetNameException
- if the given charset name is illegaljava.lang.IllegalArgumentException
- if resulting String length would be
greater than Integer.MAX_VALUEjava.lang.OutOfMemoryError
- if not enough memory to hold Blob as a single StringFetchException
java.lang.String asString(java.nio.charset.Charset charset) throws FetchException
charset
- character set to decode Stringjava.lang.IllegalArgumentException
- if resulting String length would be
greater than Integer.MAX_VALUEjava.lang.OutOfMemoryError
- if not enough memory to hold Blob as a single StringFetchException
java.io.OutputStream openOutputStream() throws PersistException
java.lang.IllegalArgumentException
- if position is negativePersistException
java.io.OutputStream openOutputStream(long pos) throws PersistException
pos
- desired zero-based position to write tojava.lang.IllegalArgumentException
- if position is negativePersistException
java.io.OutputStream openOutputStream(long pos, int bufferSize) throws PersistException
pos
- desired zero-based position to write tobufferSize
- suggest that the output stream buffer be at least this large (in bytes)java.lang.IllegalArgumentException
- if position is negativePersistException
void setLength(long length) throws PersistException
length
- new length to set tojava.lang.IllegalArgumentException
- if length is negativePersistDeniedException
- if Blob is read-onlyPersistException
void setValue(java.lang.String value) throws PersistException
value
- Blob is overwritten with this valuejava.lang.IllegalArgumentException
- if value is nullPersistException
void setValue(java.lang.String value, java.lang.String charsetName) throws PersistException
value
- Blob is overwritten with this valuecharsetName
- name of character set to encode Stringjava.nio.charset.IllegalCharsetNameException
- if the given charset name is illegaljava.lang.IllegalArgumentException
- if value is nullPersistException
void setValue(java.lang.String value, java.nio.charset.Charset charset) throws PersistException
value
- Blob is overwritten with this valuecharset
- character set to encode Stringjava.lang.IllegalArgumentException
- if value is nullPersistException
Copyright © 2006-2013 Amazon Technologies, Inc.. All Rights Reserved.