Category: Collections-Sequenceable
Superclass: ArrayedCollection
My instances are similar to strings in that they are both represented as a sequence of bytes, but my individual elements are integers, where as a String's elements are characters.

Method category index

instance creation (class)
basic (instance)
built ins (instance)
CObject (instance)
converting (instance)
more advanced accessing (instance)
storing (instance)

instance creation (class)

fromCData: aCObject size: anInteger
Answer a ByteArray containing anInteger bytes starting at the location pointed to by aCObject

top


basic (instance)

= aCollection
Answer whether the receiver's items match those in aCollection

indexOf: anElement startingAt: anIndex

Answer the first index > anIndex which contains anElement. Invoke exceptionBlock and answer its result if no item is found

indexOf: anElement startingAt: anIndex ifAbsent: exceptionBlock

Answer the first index > anIndex which contains anElement. Invoke exceptionBlock and answer its result if no item is found

top


built ins (instance)

asCData: aCType
Allocate memory with malloc for a copy of the receiver, and return it converted to a CObject with the given type

at: anIndex ifAbsent: aBlock

Answer the index-th indexed instance variable of the receiver

byteAt: index

Answer the index-th indexed instance variable of the receiver

byteAt: index put: value

Store the `value' byte in the index-th indexed instance variable of the receiver

hash

Answer an hash value for the receiver

replaceFrom: start to: stop with: aByteArray startingAt: replaceStart

Replace the characters from start to stop with the bytes contained in aByteArray (which, actually, can be any variable byte class), starting at the replaceStart location of aByteArray

replaceFrom: start to: stop withString: aString startingAt: replaceStart

Replace the characters from start to stop with the ASCII codes contained in aString (which, actually, can be any variable byte class), starting at the replaceStart location of aString

top


CObject (instance)

asCData
Allocate memory with malloc for a copy of the receiver, and return a pointer to it as a CByte.

castTo: type

Give access to the receiver as a value with the given CType.

top


converting (instance)

asString
Answer a String whose character's ASCII codes are the receiver's contents

asUnicodeString

Answer a UnicodeString whose character's codes are the receiver's contents. This is not implemented unless you load the I18N package.

top


more advanced accessing (instance)

charAt: index
Access the C char at the given index in the receiver. The value is returned as a Smalltalk Character. Indices are 1-based just like for other Smalltalk access.

charAt: index put: value

Store as a C char the Smalltalk Character or Integer object identified by `value', at the given index in the receiver, using sizeof(char) bytes - i.e. 1 byte. Indices are 1-based just like for other Smalltalk access.

doubleAt: index

Access the C double at the given index in the receiver. Indices are 1-based just like for other Smalltalk access.

doubleAt: index put: value

Store the Smalltalk Float object identified by `value', at the given index in the receiver, writing it like a C double. Indices are 1-based just like for other Smalltalk access.

floatAt: index

Access the C float at the given index in the receiver. Indices are 1-based just like for other Smalltalk access.

floatAt: index put: value

Store the Smalltalk Float object identified by `value', at the given index in the receiver, writing it like a C float. Indices are 1-based just like for other Smalltalk access.

intAt: index

Access the C int at the given index in the receiver. Indices are 1-based just like for other Smalltalk access.

intAt: index put: value

Store the Smalltalk Integer object identified by `value', at the given index in the receiver, using sizeof(int) bytes. Indices are 1-based just like for other Smalltalk access.

longAt: index

Access the C long int at the given index in the receiver. Indices are 1-based just like for other Smalltalk access.

longAt: index put: value

Store the Smalltalk Integer object identified by `value', at the given index in the receiver, using sizeof(long) bytes. Indices are 1-based just like for other Smalltalk access.

longDoubleAt: index

Access the C long double at the given index in the receiver. Indices are 1-based just like for other Smalltalk access.

longDoubleAt: index put: value

Store the Smalltalk Float object identified by `value', at the given index in the receiver, writing it like a C double. Indices are 1-based just like for other Smalltalk access.

objectAt: index

Access the Smalltalk object (OOP) at the given index in the receiver. Indices are 1-based just like for other Smalltalk access.

objectAt: index put: value

Store a pointer (OOP) to the Smalltalk object identified by `value', at the given index in the receiver. Indices are 1-based just like for other Smalltalk access.

shortAt: index

Access the C short int at the given index in the receiver. Indices are 1-based just like for other Smalltalk access.

shortAt: index put: value

Store the Smalltalk Integer object identified by `value', at the given index in the receiver, using sizeof(short) bytes. Indices are 1-based just like for other Smalltalk access.

stringAt: index

Access the string pointed by the C `char *' at the given index in the receiver. Indices are 1-based just like for other Smalltalk access.

stringAt: index put: value

Store the Smalltalk String object identified by `value', at the given index in the receiver, writing it like a *FRESHLY ALLOCATED* C string. It is the caller's responsibility to free it if necessary. Indices are 1-based just like for other Smalltalk access.

ucharAt: index

Access the C unsigned char at the given index in the receiver. The value is returned as a Smalltalk Character. Indices are 1-based just like for other Smalltalk access.

ucharAt: index put: value

Store as a C char the Smalltalk Character or Integer object identified by `value', at the given index in the receiver, using sizeof(char) bytes - i.e. 1 byte. Indices are 1-based just like for other Smalltalk access.

uintAt: index

Access the C unsigned int at the given index in the receiver. Indices are 1-based just like for other Smalltalk access.

uintAt: index put: value

Store the Smalltalk Integer object identified by `value', at the given index in the receiver, using sizeof(int) bytes. Indices are 1-based just like for other Smalltalk access.

ulongAt: index

Access the C unsigned long int at the given index in the receiver. Indices are 1-based just like for other Smalltalk access.

ulongAt: index put: value

Store the Smalltalk Integer object identified by `value', at the given index in the receiver, using sizeof(long) bytes. Indices are 1-based just like for other Smalltalk access.

unsignedCharAt: index

Access the C unsigned char at the given index in the receiver. The value is returned as a Smalltalk Character. Indices are 1-based just like for other Smalltalk access.

unsignedCharAt: index put: value

Store as a C char the Smalltalk Character or Integer object identified by `value', at the given index in the receiver, using sizeof(char) bytes - i.e. 1 byte. Indices are 1-based just like for other Smalltalk access.

unsignedIntAt: index

Access the C unsigned int at the given index in the receiver. Indices are 1-based just like for other Smalltalk access.

unsignedIntAt: index put: value

Store the Smalltalk Integer object identified by `value', at the given index in the receiver, using sizeof(int) bytes. Indices are 1-based just like for other Smalltalk access.

unsignedLongAt: index

Access the C unsigned long int at the given index in the receiver. Indices are 1-based just like for other Smalltalk access.

unsignedLongAt: index put: value

Store the Smalltalk Integer object identified by `value', at the given index in the receiver, using sizeof(long) bytes. Indices are 1-based just like for other Smalltalk access.

unsignedShortAt: index

Access the C unsigned short int at the given index in the receiver. Indices are 1-based just like for other Smalltalk access.

unsignedShortAt: index put: value

Store the Smalltalk Integer object identified by `value', at the given index in the receiver, using sizeof(short) bytes. Indices are 1-based just like for other Smalltalk access.

ushortAt: index

Access the C unsigned short int at the given index in the receiver. Indices are 1-based just like for other Smalltalk access.

ushortAt: index put: value

Store the Smalltalk Integer object identified by `value', at the given index in the receiver, using sizeof(short) bytes. Indices are 1-based just like for other Smalltalk access.

top


storing (instance)

isLiteralObject
Answer whether the receiver is expressible as a Smalltalk literal.

storeLiteralOn: aStream

Put a Smalltalk literal evaluating to the receiver on aStream.

storeOn: aStream

Put Smalltalk code evaluating to the receiver on aStream.

top