Code Duplication    Length = 7-8 lines in 2 locations

PHPDaemon/Network/IOStream.php 2 locations

@@ 910-916 (lines=7) @@
907
     * @param  integer $n Max. number of bytes to move
908
     * @return integer|false
909
     */
910
    public function moveToBuffer(\EventBuffer $dest, $n)
911
    {
912
        if (!isset($this->bev)) {
913
            return false;
914
        }
915
        return $dest->appendFrom($this->bev->input, $n);
916
    }
917
918
    /**
919
     * Moves arbitrary number of bytes from given buffer to output buffer
@@ 924-931 (lines=8) @@
921
     * @param  integer $n Max. number of bytes to move
922
     * @return integer|false
923
     */
924
    public function writeFromBuffer(\EventBuffer $src, $n)
925
    {
926
        if (!isset($this->bev)) {
927
            return false;
928
        }
929
        $this->writing = true;
930
        return $this->bev->output->appendFrom($src, $n);
931
    }
932
933
    /**
934
     * Read data from the connection's buffer