Back: Browser class-browsing
Up: Class reference
Forward: ByteArray-built ins
 
Top: GNU Smalltalk User's Guide
Contents: Table of Contents
Index: Class index
About: About this document

6.13 ByteArray

Defined in namespace Smalltalk
Category: Collections-Unordered
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.

6.13.1 ByteArray: built ins  (instance)
6.13.2 ByteArray: converting  (instance)
6.13.3 ByteArray: copying  (instance)
6.13.4 ByteArray: more advanced accessing  (instance)


6.13.1 ByteArray: built ins

asCData: aCType
Convert the receiver to a CObject with the given type

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

primReplaceFrom: start to: stop with: aByteArray startingAt: srcIndex
Private - 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 srcIndex location of aString

replaceFrom: start to: stop withString: aString startingAt: srcIndex
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 srcIndex location of aString


6.13.2 ByteArray: converting

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


6.13.3 ByteArray: copying

deepCopy
Answer a shallow copy of the receiver

shallowCopy
Answer a shallow copy of the receiver


6.13.4 ByteArray: more advanced accessing

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.

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.




This document was generated on May, 12 2002 using texi2html