mirror of https://github.com/perkeep/perkeep.git
zip: add LastDataOffset field to zip.Writer.
For blobpacked. Change-Id: I23c325d945b0eff2ec8f47259bc527f1d4f6031f
This commit is contained in:
parent
2fbb26f9bb
commit
9e0065fe8d
|
@ -1,3 +1,14 @@
|
|||
This directory contains portions of the standard library imported from tip to
|
||||
take advantage of new features and bug fixes before they're available in the
|
||||
stable branch.
|
||||
This directory contains code from the Go standard library either
|
||||
imported from tip (to take advantage of new features and bug fixes
|
||||
before they're available in the stable branch), or modified in ways
|
||||
that Camlistore needs.
|
||||
|
||||
A summary:
|
||||
|
||||
* pkg/image/jpeg: performance improvements going into Go 1.4
|
||||
such as https://codereview.appspot.com/109050045/
|
||||
|
||||
* pkg/archive/zip: new writing LastDataOffset accessor needed for
|
||||
blobpacked
|
||||
|
||||
See the git history for more details.
|
||||
|
|
|
@ -22,6 +22,12 @@ type Writer struct {
|
|||
dir []*header
|
||||
last *fileWriter
|
||||
closed bool
|
||||
|
||||
// LastDataOffset is the offset from the beginning of the zip
|
||||
// file where the most recently created file's data will be
|
||||
// (possibly be compressed). This offset is past the zip
|
||||
// header.
|
||||
LastDataOffset int64
|
||||
}
|
||||
|
||||
type header struct {
|
||||
|
@ -219,6 +225,7 @@ func (w *Writer) CreateHeader(fh *FileHeader) (io.Writer, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
w.LastDataOffset = w.cw.count
|
||||
w.last = fw
|
||||
return fw, nil
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue