simplify pxar module structure

This commit is contained in:
Dietmar Maurer
2019-03-15 08:24:32 +01:00
parent 1ef46b81d3
commit 3dbfe5b142
6 changed files with 22 additions and 18 deletions

View File

@ -22,14 +22,14 @@ use nix::errno::Errno;
use nix::NixPath;
// This one need Read, but works without Seek
pub struct PxarDecoder<'a, R: Read> {
pub struct SequentialDecoder<'a, R: Read> {
reader: &'a mut R,
skip_buffer: Vec<u8>,
}
const HEADER_SIZE: u64 = std::mem::size_of::<CaFormatHeader>() as u64;
impl <'a, R: Read> PxarDecoder<'a, R> {
impl <'a, R: Read> SequentialDecoder<'a, R> {
pub fn new(reader: &'a mut R) -> Self {
let skip_buffer = vec![0u8; 64*1024];