|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.io.OutputStream
java.io.ByteArrayOutputStream
com.orientechnologies.jdo.types.oBinary
Handles binary stream. It works like BLOB type in Relational DBMS.
| Field Summary |
| Fields inherited from class java.io.ByteArrayOutputStream |
buf, count |
| Constructor Summary | |
oBinary()
Create a new object. |
|
oBinary(byte[] iData)
Create a new object with value iData. |
|
oBinary(int iStartSize)
Create a new object preallocating iStartSize bytes to optimize performances avoiding unnecessary reallocations. |
|
| Method Summary | |
void |
append(byte[] iData,
int iLength)
Append a byte array to the stream |
void |
append(oBinary iSource)
Append another oBinary content in current stream |
void |
append(java.lang.String iData)
Append a string to the stream |
static void |
copy(byte[] iDest,
byte[] iSource,
int iDestOffset,
int iSourceOffset,
int iSize)
Static method to copy portion of byte arrays using fast-optimized JVM System.arraycopy() method. |
void |
get(byte[] ioData,
int iStart,
int iLength)
Get a portion of binary stream starting from iStart byte with length iLength. |
byte[] |
getBuffer()
Return internal stream buffer as byte array object. |
static void |
move(byte[] iDest,
byte[] iSource,
int iDestOffset,
int iSourceOffset,
int iSize)
Static method to move portion of byte arrays. |
void |
reserve(int iSize)
Reserve space in stream to optimize further enlargements. |
void |
reset()
Reset the binary content |
void |
set(byte[] iData,
int iStart,
int iLength)
Set a portion of binary stream starting from iStart byte with length iLength. |
int |
size()
Get length of binary stream |
byte[] |
toByteArray()
Copy internal stream content in a new byte array allocated with stream length. |
java.lang.String |
toString()
Convert the binary stream to a string. |
java.lang.String |
toStringByte()
Convert the binary stream to a string. |
void |
write(byte[] iData,
int iStart,
int iLength)
Append a binary array to the stream |
void |
write(int iData)
Append a byte (as int value) to the stream |
| Methods inherited from class java.io.ByteArrayOutputStream |
close, toString, toString, writeTo |
| Methods inherited from class java.io.OutputStream |
flush, write |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public oBinary()
public oBinary(byte[] iData)
public oBinary(int iStartSize)
| Method Detail |
public void reset()
public void get(byte[] ioData,
int iStart,
int iLength)
ioData - Byte array to copy portion of stream. Byte array must be allocated
with enought space (at least iLength) before the call.iStart - Start address in the stream to copyiLength - Number of bytes to copy
public void set(byte[] iData,
int iStart,
int iLength)
iStart - Start address in the stream to copyiLength - Number of bytes to copypublic void write(int iData)
iData - int value to copy. Will be casted to byte internally
public void write(byte[] iData,
int iStart,
int iLength)
iData - Byte Array to copyiStart - Start address in the byte array iDataiLength - Number of bytes to copypublic void append(java.lang.String iData)
iData - String to copy
public void append(byte[] iData,
int iLength)
iData - Byte Array to copyiLength - Number of bytes to copypublic void append(oBinary iSource)
iSource - Source oBinary object to copypublic void reserve(int iSize)
iSize - Number of bytes to allocates. If iSize is minor or equals to
the current stream size, then reservation is ignoredpublic byte[] getBuffer()
public java.lang.String toStringByte()
public java.lang.String toString()
public byte[] toByteArray()
Use getBuffer() method if you want to access to the internal buffer avoiding byte copying.
getBuffer()public int size()
public static void copy(byte[] iDest,
byte[] iSource,
int iDestOffset,
int iSourceOffset,
int iSize)
iDest - Destination byte array where to copy iniSource - Source byte array to copyiDestOffset - Destination offset where start to copy iniSourceOffset - Source offset where start to copyiSize - Number of bytes to copymove(byte[], byte[], int, int, int)
public static void move(byte[] iDest,
byte[] iSource,
int iDestOffset,
int iSourceOffset,
int iSize)
iDest - Destination byte array where to move iniSource - Source byte array to moveiDestOffset - Destination offset where start to move iniSourceOffset - Source offset where start to moveiSize - Number of bytes to movecopy(byte[], byte[], int, int, int)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||