Files
ezbookkeeping/pkg/storage/bytes_slice_object.go
T
2025-08-02 01:26:29 +08:00

23 lines
497 B
Go

package storage
import (
"bytes"
)
// bytesSliceObject represents a byte slice object in storage
type bytesSliceObject struct {
*bytes.Reader
}
// Close does nothing because it does not hold any resources that need to be released
func (b *bytesSliceObject) Close() error {
return nil
}
// newByteSliceObject creates a new byte slice object from the specified byte slice
func newByteSliceObject(data []byte) ObjectInStorage {
return &bytesSliceObject{
Reader: bytes.NewReader(data),
}
}