| 121 | } |
| 122 | |
| 123 | ByteArray ByteArray::sub(size_t b, size_t s) const { |
| 124 | if (b == 0 && s >= m_size) { |
| 125 | return ByteArray(*this); |
| 126 | } else { |
| 127 | return ByteArray(m_data + b, min(m_size, b + s)); |
| 128 | } |
| 129 | } |
| 130 | |
| 131 | ByteArray ByteArray::left(size_t s) const { |
| 132 | return sub(0, s); |