Search code examples
smalltalkpharosqueak

What is the most efficient way to join two instances of ByteArray?


I want to join two instance of ByteArray in Squeak, Cuis or Pharo Smalltalk

b := #[10 11 12 13] asOrderedCollection.
b addAll: #[21 22 23 24].
b asByteArray

Are there more efficient ways to do this?


Solution

  • Would concatenation be better...?

    #[10 11 12 13],#[21 22 23 24 ]