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,OSerializableStream,Serializable,Comparable<OIdentifiable>,Comparator<OIdentifiable>
- Direct Known Subclasses:
ORecordBytesLazy
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) Unmarshalls the object.bytereset(byte[] iSource) protected voidvoidbyte[]toStream()Marshalls the object.Methods inherited from class com.orientechnologies.orient.core.record.ORecordAbstract
addIdentityChangeListener, checkForLoading, clearSource, compare, compareTo, copyTo, delete, detach, equals, fill, fill, flatCopy, fromJSON, fromJSON, fromJSON, fromJSON, fromStream, getDatabase, getDatabaseIfDefined, getDatabaseIfDefinedInternal, getDatabaseInternal, getDirtyManager, getIdentity, getInternalStatus, getOwner, getRecord, getSize, getVersion, hashCode, isContentChanged, isDirty, isLocked, load, lock, lockingStrategy, onAfterIdentityChanged, onBeforeIdentityChanged, reload, reload, reload, reload, removeIdentityChangeListener, reset, save, save, save, save, setContentChanged, setDirty, setDirtyManager, setDirtyNoChanged, setIdentity, setIdentity, setInternalStatus, setVersion, toJSON, toJSON, toJSON, toJSON, toString, track, unload, unlock, 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
getRecord, isLocked, lock, lockingStrategy, unlockMethods inherited from interface com.orientechnologies.orient.core.record.ORecord
delete, detach, fromJSON, getDatabase, getIdentity, getInternalStatus, getSize, getVersion, isDirty, load, reload, reload, reset, save, save, save, save, 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
Description copied from interface:OSerializableStreamUnmarshalls the object. Fills the current object with the values contained in the byte array representation restoring a previous state. Usually byte[] comes from the storage or network.- Specified by:
fromStreamin interfaceOSerializableStream- Overrides:
fromStreamin classORecordAbstract- Parameters:
iRecordBuffer- byte array representation of the object- Returns:
- The Object instance itself giving a "fluent interface". Useful to call multiple methods in chain.
-
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()Description copied from interface:OSerializableStreamMarshalls the object. Transforms the current object in byte[] form to being stored or transferred over the network.- Specified by:
toStreamin interfaceOSerializableStream- Overrides:
toStreamin classORecordAbstract- Returns:
- The byte array representation of the object
- See Also:
-
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
-