# HG changeset patch # User Claus Gittinger # Date 1558962111 -7200 # Node ID ee8d63b7e7a45035fac480b4b3af76fef6698302 # Parent ddd5ab5bc4036301f869d5bb04af706bd6ebb1f9 #OTHER by cg category of: #postCopy #postDeepCopy #postDeepCopyFrom: diff -r ddd5ab5bc403 -r ee8d63b7e7a4 ImmutableByteArray.st --- a/ImmutableByteArray.st Mon May 27 15:01:44 2019 +0200 +++ b/ImmutableByteArray.st Mon May 27 15:01:51 2019 +0200 @@ -1,5 +1,3 @@ -"{ Encoding: utf8 }" - " COPYRIGHT (c) 2009 by eXept Software AG All Rights Reserved @@ -319,6 +317,21 @@ !ImmutableByteArray methodsFor:'copying'! +shallowCopy + "when copying, return a real (mutable) ByteArray" + + |sz| + + sz := self size. + ^ (ByteArray new:sz) replaceBytesFrom:1 to:sz with:self startingAt:1 + + " + #[1 2 3 4] asImmutableByteArray shallowCopy + " +! ! + +!ImmutableByteArray methodsFor:'copying-private'! + postCopy "when copied, make me a real (mutable) ByteArray" @@ -335,19 +348,6 @@ #[1 2 3 4] asImmutableByteArray shallowCopy class #[1 2 3 4] asImmutableByteArray deepCopy class " -! - -shallowCopy - "when copying, return a real (mutable) ByteArray" - - |sz| - - sz := self size. - ^ (ByteArray new:sz) replaceBytesFrom:1 to:sz with:self startingAt:1 - - " - #[1 2 3 4] asImmutableByteArray shallowCopy - " ! ! !ImmutableByteArray methodsFor:'printing & storing'!