public function stream_seek($offset, $whence)
    {
        switch ( $whence ) {
            case SEEK_SET:
                if ( ( $offset < $this->length ) &&
                     ( $offset >= 0 ) )
                {
                     $this->position = $offset;
                     return true;
                }
                else
                {
                     return false;
                }
                break;

            case SEEK_CUR:
                if ( $offset >= 0 )
                {
                     $this->position += $offset;
                     return true;
                }
                else
                {
                     return false;
                }
                break;

            case SEEK_END:
                if ( ( $this->length + $offset ) >= 0 )
                {
                     $this->position = $this->length + $offset;
                     return true;
                }
                else
                {
                     return false;
                }
                break;

            default:
                return false;
        }
    }