Squeak Class Documentation category index | class index  
 
ByteArray
  category: Collections-Arrayed
  superclass: ArrayedCollection
  subclasses: CompiledMethod CompiledApplescript ExternalAddress

I represent an ArrayedCollection whose elements are integers between 0 and 255.

instance methods
  accessing
  atAllPut:
byteAt:
byteAt:put:
byteSize
bytesPerElement

  comparing
  hash

  converting
  asByteArray
asString

  external access
  booleanAt:
booleanAt:put:
doubleAt:
doubleAt:put:
floatAt:
floatAt:put:
integerAt:put:size:signed:
integerAt:size:signed:
isExternalAddress
pointerAt:
pointerAt:put:
signedByteAt:
signedByteAt:put:
signedCharAt:
signedCharAt:put:
signedLongAt:
signedLongAt:put:
signedLongLongAt:
signedLongLongAt:put:
signedShortAt:
signedShortAt:put:
structAt:length:
structAt:put:length:
unsignedByteAt:
unsignedByteAt:put:
unsignedCharAt:
unsignedCharAt:put:
unsignedLongAt:
unsignedLongAt:put:
unsignedLongLongAt:
unsignedLongLongAt:put:
unsignedShortAt:
unsignedShortAt:put:
voidAt:
voidAt:put:

  platform independent access
  longAt:bigEndian:
longAt:put:bigEndian:
shortAt:bigEndian:
shortAt:put:bigEndian:
unsignedLongAt:bigEndian:
unsignedLongAt:put:bigEndian:
unsignedShortAt:bigEndian:
unsignedShortAt:put:bigEndian:

  private
  asByteArrayPointer
asExternalPointer
defaultElement
replaceFrom:to:with:startingAt:

class methods
  plugin generation
  ccg:emitLoadFor:from:on:
ccg:prolog:expr:index:
ccgDeclareCForVar:

instance methods
  accessing top  
 

atAllPut:

Fill the receiver with the given value


 

byteAt:


 

byteAt:put:


 

byteSize


 

bytesPerElement

Number of bytes in each item. This multiplied by (self size)*8 gives the number of bits stored.


  comparing top  
 

hash

Answer an integer hash value for the receiver such that,
-- the hash value of an unchanged object is constant over time, and
-- two equal objects have equal hash values


  converting top  
 

asByteArray

Answer a ByteArray whose elements are the elements of the receiver.


 

asString

Convert to a String with Characters for each byte.
Fast code uses primitive that avoids character conversion


  external access top  
 

booleanAt:

bool is only valid with function declarations


 

booleanAt:put:

bool is only valid with function declarations


 

doubleAt:


 

doubleAt:put:


 

floatAt:


 

floatAt:put:


 

integerAt:put:size:signed:

Primitive. Store the given value as integer of nBytes size
in the receiver. Fail if the value is out of range.
Note: This primitive will access memory in the outer space if
invoked from ExternalAddress.


 

integerAt:size:signed:

Primitive. Return an integer of nBytes size from the receiver.
Note: This primitive will access memory in the outer space if
invoked from ExternalAddress.


 

isExternalAddress

Return true if the receiver describes an object in the outside world


 

pointerAt:

Return a pointer object stored at the given byte address


 

pointerAt:put:

Store a pointer object at the given byte address


 

signedByteAt:

Return a 8bit signed integer starting at the given byte offset


 

signedByteAt:put:

Store a 8bit signed integer starting at the given byte offset


 

signedCharAt:


 

signedCharAt:put:


 

signedLongAt:

Return a 32bit signed integer starting at the given byte offset


 

signedLongAt:put:

Store a 32bit signed integer starting at the given byte offset


 

signedLongLongAt:

This is not yet supported


 

signedLongLongAt:put:

This is not yet supported


 

signedShortAt:

Return a 16bit signed integer starting at the given byte offset


 

signedShortAt:put:

Store a 16bit signed integer starting at the given byte offset


 

structAt:length:

Return a structure of the given length starting at the indicated byte offset.


 

structAt:put:length:

Store a structure of the given length starting at the indicated byte offset.


 

unsignedByteAt:

Return a 8bit unsigned integer starting at the given byte offset


 

unsignedByteAt:put:

Store a 8bit unsigned integer starting at the given byte offset


 

unsignedCharAt:


 

unsignedCharAt:put:


 

unsignedLongAt:

Return a 32bit unsigned integer starting at the given byte offset


 

unsignedLongAt:put:

Store a 32bit signed integer starting at the given byte offset


 

unsignedLongLongAt:

This is not yet supported


 

unsignedLongLongAt:put:

This is not yet supported


 

unsignedShortAt:

Return a 16bit unsigned integer starting at the given byte offset


 

unsignedShortAt:put:

Store a 16bit unsigned integer starting at the given byte offset


 

voidAt:

no accessors for void


 

voidAt:put:

no accessors for void


  platform independent access top  
 

longAt:bigEndian:

Return a 32bit integer quantity starting from the given byte index


 

longAt:put:bigEndian:

Return a 32bit integer quantity starting from the given byte index


 

shortAt:bigEndian:

Return a 16 bit integer quantity starting from the given byte index


 

shortAt:put:bigEndian:

Store a 16 bit integer quantity starting from the given byte index


 

unsignedLongAt:bigEndian:

Return a 32bit unsigned integer quantity starting from the given byte index


 

unsignedLongAt:put:bigEndian:

Store a 32bit unsigned integer quantity starting from the given byte index


 

unsignedShortAt:bigEndian:

Return a 16 bit unsigned integer quantity starting from the given byte index


 

unsignedShortAt:put:bigEndian:

Store a 16 bit unsigned integer quantity starting from the given byte index


  private top  
 

asByteArrayPointer

Return a ByteArray describing a pointer to the contents of the receiver.


 

asExternalPointer

Convert the receiver assuming that it describes a pointer to an object.


 

defaultElement


 

replaceFrom:to:with:startingAt:

Primitive. This destructively replaces elements from start to stop in the receiver starting at index, repStart, in the collection, replacement. Answer the receiver. Range checks are performed in the primitive only. Optional. See Object documentation whatIsAPrimitive.


class methods
  plugin generation top  
 

ccg:emitLoadFor:from:on:


 

ccg:prolog:expr:index:


 

ccgDeclareCForVar: