func (r *checksumReader) Close() error { return r.rc.Close() }
-func readFileHeader(f *File, r io.Reader) error {
- var buf [fileHeaderLen]byte
- if _, err := io.ReadFull(r, buf[:]); err != nil {
- return err
- }
- b := readBuf(buf[:])
- if sig := b.uint32(); sig != fileHeaderSignature {
- return ErrFormat
- }
- f.ReaderVersion = b.uint16()
- f.Flags = b.uint16()
- f.Method = b.uint16()
- f.ModifiedTime = b.uint16()
- f.ModifiedDate = b.uint16()
- f.CRC32 = b.uint32()
- f.CompressedSize = b.uint32()
- f.UncompressedSize = b.uint32()
- filenameLen := int(b.uint16())
- extraLen := int(b.uint16())
- d := make([]byte, filenameLen+extraLen)
- if _, err := io.ReadFull(r, d); err != nil {
- return err
- }
- f.Name = string(d[:filenameLen])
- f.Extra = d[filenameLen:]
- return nil
-}
-
// findBodyOffset does the minimum work to verify the file has a header
// and returns the file body offset.
func (f *File) findBodyOffset() (int64, error) {
ErrInvalidUnreadRune = errors.New("bufio: invalid use of UnreadRune")
ErrBufferFull = errors.New("bufio: buffer full")
ErrNegativeCount = errors.New("bufio: negative count")
- errInternal = errors.New("bufio: internal error")
)
// Buffered input.
return "json: error calling MarshalJSON for type " + e.Type.String() + ": " + e.Err.Error()
}
-type interfaceOrPtrValue interface {
- IsNil() bool
- Elem() reflect.Value
-}
-
var hex = "0123456789abcdef"
// An encodeState encodes JSON into a bytes.Buffer.
return false
}
-func isSpace(c byte) bool {
- switch c {
- case ' ', '\t', '\r', '\n':
- return true
- }
- return false
-}
-
func isCtl(c byte) bool { return (0 <= c && c <= 31) || c == 127 }
func isChar(c byte) bool { return 0 <= c && c <= 127 }
return (t.sec+internalToUnix)*1e9 + int64(t.nsec)
}
-type gobError string
-
-func (g gobError) Error() string { return string(g) }
-
const timeGobVersion byte = 1
// GobEncode implements the gob.GobEncoder interface.