public function stream_truncate($aSize): bool
    {
        if (strlen($this->string) > $aSize) {
            $this->string = substr($this->string, 0, $aSize);
        } elseif (strlen($this->string) < $aSize) {
            $this->string = str_pad($this->string, $aSize, "\0", STR_PAD_RIGHT);
        }

        return true;
    }
public function stream_truncate($aSize): bool
    {
        if (strlen($this->string) > $aSize) {
            $this->string = substr($this->string, 0, $aSize);
        } elseif (strlen($this->string) < $aSize) {
            $this->string = str_pad($this->string, $aSize, "\0", STR_PAD_RIGHT);
        }

        return true;
    }
public function stream_truncate ( $ aSize ) : bool { if ( strlen ( $ this -> string ) > $ aSize ) { $ this -> string = substr ( $ this -> string , 0 , $ aSize ) ; } elseif ( strlen ( $ this -> string ) < $ aSize ) { $ this -> string = str_pad ( $ this -> string , $ aSize , "\0" , STR_PAD_RIGHT ) ; } return true ; }
Truncate to given size.

@param int $aSize

@return bool
Truncate to given size .