github.com/linuxboot/fiano@v1.2.0/pkg/cbfs/unknown.go (about)

     1  // Copyright 2018-2023 the LinuxBoot Authors. All rights reserved
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package cbfs
     6  
     7  import (
     8  	"io"
     9  )
    10  
    11  func NewUnknownRecord(f *File) (ReadWriter, error) {
    12  	r := &UnknownRecord{File: *f}
    13  	Debug("Got header %v", r.String())
    14  	r.Attr = make([]byte, 16)
    15  	r.FData = ffbyte(f.Size)
    16  	return r, nil
    17  }
    18  
    19  func (r *UnknownRecord) Read(in io.ReadSeeker) error {
    20  	return nil
    21  }
    22  
    23  func (r *UnknownRecord) String() string {
    24  	return recString(r.File.Name, r.RecordStart, r.File.Type.String(), r.Size, r.File.Compression().String())
    25  }
    26  
    27  func (r *UnknownRecord) Write(w io.Writer) error {
    28  	return Write(w, r.FData)
    29  }
    30  
    31  func (r *UnknownRecord) GetFile() *File {
    32  	return &r.File
    33  }