|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.amazon.carbonado.lob.AbstractBlob
com.amazon.carbonado.lob.ByteArrayBlob
public class ByteArrayBlob
Implementation of a Blob which is backed by a growable in-memory byte array.
| Constructor Summary | |
|---|---|
ByteArrayBlob(byte[] data)
Construct a ByteArrayBlob initially backed by the given byte array. |
|
ByteArrayBlob(byte[] data,
int length)
Construct a ByteArrayBlob initially backed by the given byte array. |
|
ByteArrayBlob(int capacity)
Construct a ByteArrayBlob with the given initial capacity. |
|
| Method Summary | |
|---|---|
long |
getLength()
Returns the length of this Blob, in bytes. |
Object |
getLocator()
Always returns null. |
InputStream |
openInputStream()
Returns an InputStream for reading Blob data positioned at the start. |
InputStream |
openInputStream(long pos)
Returns an InputStream for reading Blob data. |
InputStream |
openInputStream(long pos,
int bufferSize)
Returns an InputStream for reading Blob data. |
OutputStream |
openOutputStream()
Returns an OutputStream for writing Blob data, positioned at the start. |
OutputStream |
openOutputStream(long pos)
Returns an OutputStream for writing Blob data. |
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. |
| Methods inherited from class com.amazon.carbonado.lob.AbstractBlob |
|---|
asString, asString, asString, equals, hashCode, setValue, setValue, setValue, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ByteArrayBlob(int capacity)
capacity - initial capacity of internal byte arraypublic ByteArrayBlob(byte[] data)
data - initial data backing the Blob
public ByteArrayBlob(byte[] data,
int length)
data - initial data backing the Bloblength - initial length of data| Method Detail |
|---|
public InputStream openInputStream()
Blob
public InputStream openInputStream(long pos)
Blob
pos - desired zero-based position to read from
public InputStream openInputStream(long pos,
int bufferSize)
Blob
pos - desired zero-based position to read frombufferSize - suggest that the input stream buffer be at least this large (in bytes)
public long getLength()
Blob
public OutputStream openOutputStream()
Blob
public OutputStream openOutputStream(long pos)
Blob
pos - desired zero-based position to write to
public OutputStream openOutputStream(long pos,
int bufferSize)
Blob
pos - desired zero-based position to write tobufferSize - suggest that the output stream buffer be at least this large (in bytes)
public void setLength(long length)
throws PersistException
Blob
length - new length to set to
PersistDeniedException - if Blob is read-only
PersistExceptionpublic Object getLocator()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||