pub fn resize_to_reader(&self, reader: &mut SwfStream<'_>, size: usize) -> Option<SwfSlice> {
        if self.movie.data().as_ptr() as usize <= reader.get_ref().as_ptr() as usize
            && (reader.get_ref().as_ptr() as usize)
                < self.movie.data().as_ptr() as usize + self.movie.data().len()
        {
            let outer_offset =
                reader.get_ref().as_ptr() as usize - self.movie.data().as_ptr() as usize;
            let new_start = outer_offset;
            let new_end = outer_offset + size;

            let len = self.movie.data().len();

            if new_start < len && new_end < len {
                Some(SwfSlice {
                    movie: self.movie.clone(),
                    start: new_start,
                    end: new_end,
                })
            } else {
                None
            }
        } else {
            None
        }
    }
/// Construct a new SwfSlice from a Reader and a size.
///
/// This is intended to allow constructing references to the contents of a
/// given SWF tag. You just need the current reader and the size of the tag
/// you want to reference.
///
/// The returned slice may or may not be a subslice of the current slice.
/// If the resulting slice would be outside the bounds of the underlying
/// movie, or the given reader refers to a different underlying movie, this
/// function returns None.
Construct a new SwfSlice from a Reader and a size.
This is intended to allow constructing references to the contents of a
given SWF tag. You just need the current reader and the size of the tag
you want to reference.

The returned slice may or may not be a subslice of the current slice.
If the resulting slice would be outside the bounds of the underlying
movie, or the given reader refers to a different underlying movie, this
function returns None.
Construct a new SwfSlice from a Reader and a size . This is intended to allow constructing references to the contents of a given SWF tag . You just need the current reader and the size of the tag you want to reference . The returned slice may or may not be a subslice of the current slice . If the resulting slice would be outside the bounds of the underlying movie or the given reader refers to a different underlying movie this function returns None .
pub fn resize_to_reader(&self, reader: &mut SwfStream<'_>, size: usize) -> Option<SwfSlice> {
        if self.movie.data().as_ptr() as usize <= reader.get_ref().as_ptr() as usize
            && (reader.get_ref().as_ptr() as usize)
                < self.movie.data().as_ptr() as usize + self.movie.data().len()
        {
            let outer_offset =
                reader.get_ref().as_ptr() as usize - self.movie.data().as_ptr() as usize;
            let new_start = outer_offset;
            let new_end = outer_offset + size;
            let len = self.movie.data().len();
            if new_start < len && new_end < len {
                Some(SwfSlice {
                    movie: self.movie.clone(),
                    start: new_start,
                    end: new_end,
                })
            } else {
                None
            }
        } else {
            None
        }
    }
pub fn resize_to_reader ( & self , reader : & mut SwfStream < ' _ > , size : usize ) -> Option < SwfSlice > { if self . movie . data ( ) . as_ptr ( ) as usize <= reader . get_ref ( ) . as_ptr ( ) as usize && ( reader . get_ref ( ) . as_ptr ( ) as usize ) < self . movie . data ( ) . as_ptr ( ) as usize + self . movie . data ( ) . len ( ) { let outer_offset = reader . get_ref ( ) . as_ptr ( ) as usize - self . movie . data ( ) . as_ptr ( ) as usize ; let new_start = outer_offset ; let new_end = outer_offset + size ; let len = self . movie . data ( ) . len ( ) ; if new_start < len && new_end < len { Some ( SwfSlice { movie : self . movie . clone ( ) , start : new_start , end : new_end , } ) } else { None } } else { None } }
Construct a new SwfSlice from a Reader and a size.
Construct a new SwfSlice from a Reader and a size .
&self
reader
&mut SwfStream<'_>
size
usize
&self
reader
&mut SwfStream<'_>
size
usize