20 lines
564 B
Plaintext
20 lines
564 B
Plaintext
import "pkg:/source/utils/ByteArrayUtils.bs"
|
|
|
|
namespace LoungeBytes
|
|
|
|
function RangeToString(bytes as object, fromIndex as integer, toIndex as integer) as string
|
|
return ByteArrayUtils.Slice(bytes, fromIndex, toIndex).ToAsciiString()
|
|
end function
|
|
|
|
function IndexOfByte(bytes as object, fromIndex as integer, value as integer) as integer
|
|
last = bytes.Count() - 1
|
|
for i = fromIndex to last
|
|
if bytes[i] = value
|
|
return i
|
|
end if
|
|
end for
|
|
return -1
|
|
end function
|
|
|
|
end namespace
|