Add into_reader to get the underlying reader back

This commit is contained in:
Truman Kilen 2023-01-21 11:52:30 -06:00
parent de69a98d34
commit a03dafaa15

View file

@ -56,6 +56,12 @@ fn decrypt(key: &Option<aes::Aes256Dec>, bytes: &mut [u8]) -> Result<(), super::
} }
} }
impl<R: io::Seek + io::Read> PakReader<R> {
pub fn into_reader(self) -> R {
self.reader
}
}
impl<R: io::Read + io::Seek> PakReader<R> { impl<R: io::Read + io::Seek> PakReader<R> {
pub fn new_any(mut reader: R, key: Option<aes::Aes256Dec>) -> Result<Self, super::Error> { pub fn new_any(mut reader: R, key: Option<aes::Aes256Dec>) -> Result<Self, super::Error> {
for ver in Version::iter() { for ver in Version::iter() {