added copyFrom:count: to ByteArray

This commit is contained in:
hyunghwan.chung
2018-06-12 10:17:32 +00:00
parent aa3c15d2a3
commit 34ee56784d
2 changed files with 15 additions and 3 deletions

View File

@ -110,8 +110,6 @@ class(#pointer) Array(SequenceableCollection)
^self at: (self size - 1).
}
method copy: anArray
{
0 priorTo: (anArray size) do: [:i | self at: i put: (anArray at: i) ].
@ -160,6 +158,11 @@ class(#pointer) Array(SequenceableCollection)
^(self class new: newsz) copy: self from: start to: end
}
method copyFrom: start count: count
{
^(self class new: count) copy: self from: start to: (start + count - 1)
}
method replaceFrom: start to: stop with: replacement
{
^self replaceFrom: start to: stop with: replacement startingAt: 0.