Package convex.core.data
Class ABlobLike<T extends ACell>
java.lang.Object
convex.core.data.AObject
convex.core.data.ACell
convex.core.data.ACountable<T>
convex.core.data.ABlobLike<T>
- Type Parameters:
T
- type of conceptual elements
- All Implemented Interfaces:
IValidated
,IWriteable
Abstract base class for Blob-like objects, which conceptually behave as a sequence of bytes.
-
Field Summary
Fields inherited from class convex.core.data.ACell
cachedRef, EMPTY_ARRAY
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract byte
byteAt
(long i) Gets the byte at the specified position.empty()
Returns a canonical, singleton empty instance of the same type as this Countable value.byte[]
getBytes()
Gets a byte array containing a copy of this Blob.abstract int
getBytes
(byte[] dest, int destOffset) Copies the bytes from this instance to a given destinationMethods inherited from class convex.core.data.ACountable
count, get, getElementRef, isEmpty, size, slice, slice
Methods inherited from class convex.core.data.ACell
announce, announce, attachMemorySize, attachRef, cachedEncoding, cachedHash, calcMemorySize, createAnnounced, createEncoding, createPersisted, createPersisted, createRef, encode, encodeRaw, equals, equals, getCanonical, getChildRefs, getEncoding, getEncodingLength, getHash, getMemorySize, getRef, getRef, getRefCount, getTag, getType, hashCode, isCanonical, isCompletelyEncoded, isCVMValue, isEmbedded, mark, mark, toCanonical, toCVMString, toString, updateRefs, validate, validateCell
Methods inherited from class convex.core.data.AObject
attachEncoding, print, print, print
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface convex.core.data.IWriteable
estimatedEncodingSize
-
Constructor Details
-
ABlobLike
public ABlobLike()
-
-
Method Details
-
byteAt
public abstract byte byteAt(long i) Gets the byte at the specified position. Result is undefined if out of range.- Parameters:
i
- Index of the byte to get- Returns:
- The byte at the specified position
-
empty
Description copied from class:ACountable
Returns a canonical, singleton empty instance of the same type as this Countable value.- Specified by:
empty
in classACountable<T extends ACell>
- Returns:
- An empty Countable value
-
getBytes
public byte[] getBytes()Gets a byte array containing a copy of this Blob.- Returns:
- A new byte array containing the contents of this blob.
-
getBytes
public abstract int getBytes(byte[] dest, int destOffset) Copies the bytes from this instance to a given destination- Parameters:
dest
- Destination arraydestOffset
- Offset into destination array- Returns:
- End position in destination array after writing
-