- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 33 for ReadFull (0.08 sec)
-
internal/ioutil/read_file.go
if err != nil { return nil, nil, err } defer f.Close() st, err := f.Stat() if err != nil { return nil, nil, err } dst := make([]byte, st.Size()) _, err = io.ReadFull(f, dst) return dst, st, err } // ReadFile reads the named file and returns the contents. // A successful call returns err == nil, not err == EOF.
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Sat Dec 09 18:17:51 UTC 2023 - 2.3K bytes - Viewed (0) -
cmd/streaming-v4-unsigned.go
return n, cr.err } } if cap(cr.buffer) < size { cr.buffer = make([]byte, size) } else { cr.buffer = cr.buffer[:size] } // Now, we read the payload. _, err = io.ReadFull(cr.reader, cr.buffer) if err == io.EOF && size != 0 { err = io.ErrUnexpectedEOF } if err != nil && err != io.EOF { cr.err = err return n, cr.err }
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Sat May 06 02:53:12 UTC 2023 - 6.1K bytes - Viewed (0) -
internal/config/crypto.go
const ( MaxMetadataSize = 1 << 20 // max. size of the metadata Version = 1 ) var header [5]byte if _, err := io.ReadFull(ciphertext, header[:]); err != nil { return nil, err } if header[0] != Version { return nil, fmt.Errorf("config: unknown ciphertext version %d", header[0]) } size := binary.LittleEndian.Uint32(header[1:])
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Tue May 07 23:55:37 UTC 2024 - 5K bytes - Viewed (0) -
cmd/bitrot-streaming.go
} } if offset != b.currOffset { // Can never happen unless there are programmer bugs return 0, errUnexpected } b.h.Reset() _, err = io.ReadFull(b.rc, b.hashBytes) if err != nil { return 0, err } _, err = io.ReadFull(b.rc, buf) if err != nil { return 0, err } b.h.Write(buf) if !bytes.Equal(b.h.Sum(nil), b.hashBytes) { return 0, errFileCorrupt }
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Wed Aug 21 12:20:54 UTC 2024 - 6K bytes - Viewed (0) -
cmd/dummy-data-generator_test.go
// also returned. func cmpReaders(r1, r2 io.Reader) (bool, string) { bufLen := 32 * 1024 b1, b2 := make([]byte, bufLen), make([]byte, bufLen) for i := 0; true; i++ { n1, e1 := io.ReadFull(r1, b1) n2, e2 := io.ReadFull(r2, b2) if n1 != n2 { return false, fmt.Sprintf("Read %d != %d bytes from the readers", n1, n2) } if !bytes.Equal(b1[:n1], b2[:n2]) {
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Tue Jul 02 15:13:05 UTC 2024 - 4.7K bytes - Viewed (0) -
internal/s3select/json/preader.go
if cap(dst) < skip { dst = make([]byte, 0, skip+1024) } dst = dst[:skip] if skip > 0 { n, err := io.ReadFull(r.buf, dst) if err != nil && err != io.ErrUnexpectedEOF { // If an EOF happens after reading some but not all the bytes, // ReadFull returns ErrUnexpectedEOF. return dst[:n], err } dst = dst[:n] if err == io.ErrUnexpectedEOF { return dst, io.EOF } }
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Mon Sep 23 19:35:41 UTC 2024 - 6.5K bytes - Viewed (0) -
internal/crypto/key.go
if random == nil { random = rand.Reader } if len(extKey) != 32 { // safety check logger.CriticalIf(context.Background(), errors.New("crypto: invalid key length")) } var nonce [32]byte if _, err := io.ReadFull(random, nonce[:]); err != nil { logger.CriticalIf(context.Background(), errOutOfEntropy) } const Context = "object-encryption-key generation" mac := hmac.New(sha256.New, extKey) mac.Write([]byte(Context))
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Tue Mar 19 20:28:10 UTC 2024 - 6.4K bytes - Viewed (0) -
cmd/streaming-signature-v4.go
// // The signature is 64 bytes long (hex-encoded SHA256 hash) and // starts with a 16 byte header: len("chunk-signature=") + 64 == 80. var signature [80]byte _, err = io.ReadFull(cr.reader, signature[:]) if err == io.EOF { err = io.ErrUnexpectedEOF } if err != nil { cr.err = err return n, cr.err } if !bytes.HasPrefix(signature[:], []byte("chunk-signature=")) {
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Thu May 16 23:13:47 UTC 2024 - 18.2K bytes - Viewed (0) -
cmd/erasure-encode.go
writer := &multiWriter{ writers: writers, writeQuorum: quorum, errs: make([]error, len(writers)), } for { var blocks [][]byte n, err := io.ReadFull(src, buf) if err != nil { if !IsErrIgnored(err, []error{ io.EOF, io.ErrUnexpectedEOF, }...) { return 0, err } } eof := err == io.EOF || err == io.ErrUnexpectedEOF
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Wed May 15 00:11:04 UTC 2024 - 2.9K bytes - Viewed (0) -
internal/s3select/csv/reader.go
if cap(dst) < skip { dst = make([]byte, 0, skip+1024) } dst = dst[:skip] if skip > 0 { n, err := io.ReadFull(r.buf, dst) if err != nil && err != io.ErrUnexpectedEOF { // If an EOF happens after reading some but not all the bytes, // ReadFull returns ErrUnexpectedEOF. return dst[:n], err } dst = dst[:n] if err == io.ErrUnexpectedEOF { return dst, io.EOF } }
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Thu Feb 22 06:26:06 UTC 2024 - 8.9K bytes - Viewed (0)