Code Duplication    Length = 3-4 lines in 2 locations

lib/classes/Swift/CharacterStream/ArrayCharacterStream.php 2 locations

@@ 275-278 (lines=4) @@
272
            if ($buf_len - $buf_pos > 0) {
273
274
                $size = 0;
275
                for ($i = 0; $i < $startLength && isset($buffer[$buf_pos]); ++$i) {
276
                    ++$size;
277
                    $bytes[] = $buffer[$buf_pos++];
278
                }
279
                $need = $this->_charReader->validateByteSequence($bytes, $size);
280
281
                if ($need > 0) {
@@ 291-293 (lines=3) @@
288
                        }
289
                    }
290
291
                    for ($i = 0; $i < $need && isset($buffer[$buf_pos]); ++$i) {
292
                        $bytes[] = $buffer[$buf_pos++];
293
                    }
294
                }
295
296
                $this->_array[] = $bytes;