Class ORecordBytes
java.lang.Object
com.orientechnologies.orient.core.record.ORecordAbstract
com.orientechnologies.orient.core.record.impl.ORecordBytes
- All Implemented Interfaces:
OIdentifiable,ORecordElement,OBlob,ORecord,Serializable,Comparable<OIdentifiable>,Comparator<OIdentifiable>
The rawest representation of a record. It's schema less. Use this if you need to store Strings or
byte[] without matter about the content. Useful also to store multimedia contents and binary
files. The object can be reused across calls to the database by using the reset() at every
re-use.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.orientechnologies.orient.core.db.record.ORecordElement
ORecordElement.STATUS -
Field Summary
Fields inherited from class com.orientechnologies.orient.core.record.ORecordAbstract
BASE_FORMAT, contentChanged, DEFAULT_FORMAT, dirty, dirtyManager, OLD_FORMAT_WITH_LATE_TYPES, recordFormat, recordId, recordVersion, size, source, statusFields inherited from interface com.orientechnologies.orient.core.record.impl.OBlob
RECORD_TYPE -
Constructor Summary
ConstructorsConstructorDescriptionORecordBytes(byte[] iSource) ORecordBytes(ODatabaseDocumentInternal iDatabase) ORecordBytes(ODatabaseDocumentInternal iDatabase, byte[] iSource) ORecordBytes(ORID iRecordId) -
Method Summary
Modifier and TypeMethodDescriptionclear()All the fields are deleted but the record identity is maintained.copy()Creates a copy of the record.intReads the input stream in memory.intfromInputStream(InputStream in, int maxSize) Reads the input stream in memory specifying the maximum bytes to read.fromStream(byte[] iRecordBuffer) byte[]getBytes()bytereset(byte[] iSource) voidsetBytes(byte[] bytes) protected voidvoidbyte[]toStream()Methods inherited from class com.orientechnologies.orient.core.record.ORecordAbstract
addIdentityChangeListener, checkForLoading, clearSource, compare, compareTo, copyTo, detach, equals, fill, fill, flatCopy, fromJSON, fromJSON, fromJSON, fromJSON, fromStream, getDatabase, getDatabaseIfDefined, getDatabaseIfDefinedInternal, getDatabaseInternal, getDirtyManager, getIdentity, getInternalStatus, getOwner, getRecord, getSize, getVersion, hashCode, isContentChanged, isDirty, onAfterIdentityChanged, onBeforeIdentityChanged, removeIdentityChangeListener, reset, setContentChanged, setDirty, setDirtyManager, setDirtyNoChanged, setIdentity, setIdentity, setInternalStatus, setVersion, toJSON, toJSON, toJSON, toJSON, toString, track, unload, unsetDirty, unTrackMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Comparable
compareToMethods inherited from interface java.util.Comparator
compare, equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLongMethods inherited from interface com.orientechnologies.orient.core.db.record.OIdentifiable
getRecordMethods inherited from interface com.orientechnologies.orient.core.record.ORecord
detach, fromJSON, getIdentity, getInternalStatus, getSize, getVersion, isDirty, reset, setInternalStatus, toJSON, toJSON, unloadMethods inherited from interface com.orientechnologies.orient.core.db.record.ORecordElement
getOwner, setDirty, setDirtyNoChanged
-
Constructor Details
-
ORecordBytes
public ORecordBytes() -
ORecordBytes
-
ORecordBytes
-
ORecordBytes
public ORecordBytes(byte[] iSource) -
ORecordBytes
-
-
Method Details
-
reset
-
copy
Description copied from interface:ORecordCreates a copy of the record. All the record contents are copied. -
fromStream
- Overrides:
fromStreamin classORecordAbstract
-
clear
Description copied from interface:ORecordAll the fields are deleted but the record identity is maintained. Use this to remove all the document's fields.- Specified by:
clearin interfaceORecord- Overrides:
clearin classORecordAbstract- Returns:
- The Object instance itself giving a "fluent interface". Useful to call multiple methods in chain.
-
toStream
public byte[] toStream()- Overrides:
toStreamin classORecordAbstract
-
getRecordType
public byte getRecordType()- Specified by:
getRecordTypein classORecordAbstract
-
setup
- Overrides:
setupin classORecordAbstract
-
fromInputStream
Reads the input stream in memory. This is less efficient thanfromInputStream(InputStream, int)because allocation is made multiple times. If you already know the input size usefromInputStream(InputStream, int).- Specified by:
fromInputStreamin interfaceOBlob- Parameters:
in- Input Stream, use buffered input stream wrapper to speed up reading- Returns:
- Buffer read from the stream. It's also the internal buffer size in bytes
- Throws:
IOException
-
fromInputStream
Reads the input stream in memory specifying the maximum bytes to read. This is more efficient thanfromInputStream(InputStream)because allocation is made only once.- Specified by:
fromInputStreamin interfaceOBlob- Parameters:
in- Input Stream, use buffered input stream wrapper to speed up readingmaxSize- Maximum size to read- Returns:
- Buffer count of bytes that are read from the stream. It's also the internal buffer size in bytes
- Throws:
IOException- if an I/O error occurs.
-
toOutputStream
- Specified by:
toOutputStreamin interfaceOBlob- Throws:
IOException
-
getBytes
public byte[] getBytes() -
setBytes
public void setBytes(byte[] bytes)
-