Package convex.core.data.impl
Class ZeroBlob
- All Implemented Interfaces:
IValidated,IWriteable,Comparable<ABlobLike<?>>
Blob filled with all zeros. Useful to avoid allocating lots of empty arrays, potentially.
-
Field Summary
FieldsFields inherited from class convex.core.data.ACell
cachedRef, memorySize -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAppend an additional Blob to this, creating a new Blob as needed.bytebyteAtUnchecked(long i) Gets the byte at the specified position in this data object, possibly skipping bounds checking.static ZeroBlobcreate(long count) intgetBytes(byte[] dest, int destOffset) Copies the bytes from this instance to a given destination arraysliceImpl(long start, long end) Constructs a slice of this Blob as the same type.Methods inherited from class convex.core.data.ADerivedBlob
encodeRaw, equals, equalsBytes, equalsBytes, estimatedEncodingSize, getByteBuffer, getChunk, getRefCount, hexMatch, isCanonical, isFullyPacked, longValue, read, slice, toCanonical, toFlatBlob, updateDigestMethods inherited from class convex.core.data.ABlob
byteAt, compareTo, computeHash, count, empty, encode, equals, get, getContentHash, getElementRef, getTag, getType, hashCode, isChunkPacked, isCVMValue, print, read, replaceSlice, shortAt, size, slice, toBlob, toByteBuffer, validate, validateCellMethods inherited from class convex.core.data.ABlobLike
appendHex, getBytes, getHexDigit, hexEquals, hexLength, hexMatch, isDataValue, toHexString, toHexStringMethods inherited from class convex.core.data.ACountable
isEmptyMethods inherited from class convex.core.data.ACell
attachMemorySize, attachRef, cachedEncoding, cachedHash, calcMemorySize, createEncoding, createRef, equals, genericEquals, getCanonical, getChildRefs, getEncoding, getEncodingLength, getHash, getMemorySize, getMemorySize, getRef, getRef, isEmbedded, toCVMString, toString, updateRefsMethods inherited from class convex.core.data.AObject
attachEncoding, print, print
-
Field Details
-
EMPTY
-
-
Constructor Details
-
ZeroBlob
protected ZeroBlob(long count)
-
-
Method Details
-
append
Description copied from class:ABlobAppend an additional Blob to this, creating a new Blob as needed.- Overrides:
appendin classADerivedBlob- Parameters:
other- Blob to append- Returns:
- A new Blob, containing the additional data appended to this blob.
-
sliceImpl
Description copied from class:ADerivedBlobConstructs a slice of this Blob as the same type. Assumes a new slice must be constructed and that bounds have already been checked.- Specified by:
sliceImplin classADerivedBlob- Parameters:
start- Start of sliceend- End of slice- Returns:
- New slice instance
-
create
-
getBytes
public int getBytes(byte[] dest, int destOffset) Description copied from class:ABlobLikeCopies the bytes from this instance to a given destination array- Specified by:
getBytesin classADerivedBlob- Parameters:
dest- Destination arraydestOffset- Offset into destination array- Returns:
- End position in destination array after writing
-
byteAtUnchecked
public byte byteAtUnchecked(long i) Description copied from class:ABlobLikeGets the byte at the specified position in this data object, possibly skipping bounds checking. Only safe if index is known to be in bounds, otherwise result is undefined.- Overrides:
byteAtUncheckedin classABlobLike<CVMLong>- Parameters:
i- Index of the byte to get- Returns:
- The byte at the specified position
-