Search Options

Results per page
Sort
Preferred Languages
Advance

Results 51 - 60 of 85 for newWriter (0.18 sec)

  1. src/archive/zip/register.go

    var flateWriterPool sync.Pool
    
    func newFlateWriter(w io.Writer) io.WriteCloser {
    	fw, ok := flateWriterPool.Get().(*flate.Writer)
    	if ok {
    		fw.Reset(w)
    	} else {
    		fw, _ = flate.NewWriter(w, 5)
    	}
    	return &pooledFlateWriter{fw: fw}
    }
    
    type pooledFlateWriter struct {
    	mu sync.Mutex // guards Close and Write
    	fw *flate.Writer
    }
    
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Fri Oct 13 18:36:46 GMT 2023
    - 3.7K bytes
    - Viewed (0)
  2. cmd/callhome.go

    	return err
    }
    
    func createHealthJSONGzip(ctx context.Context, healthInfo madmin.HealthInfo) []byte {
    	var b bytes.Buffer
    	gzWriter := gzip.NewWriter(&b)
    
    	header := struct {
    		Version string `json:"version"`
    	}{Version: healthInfo.Version}
    
    	enc := json.NewEncoder(gzWriter)
    	if e := enc.Encode(header); e != nil {
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Thu Apr 04 12:04:40 GMT 2024
    - 5.1K bytes
    - Viewed (1)
  3. istioctl/pkg/writer/envoy/configdump/configdump.go

    	if err != nil {
    		return err
    	}
    
    	var (
    		istioVersion, istioProxySha = c.getIstioVersionInfo(bootstrapDump)
    		envoyVersion                = c.getUserAgentVersionInfo(bootstrapDump)
    
    		tw = tabwriter.NewWriter(c.Stdout, 0, 8, 1, ' ', 0)
    	)
    
    	if len(istioVersion) > 0 {
    		fmt.Fprintf(tw, "Istio Version:\t%s\n", istioVersion)
    	}
    	if len(istioProxySha) > 0 {
    		fmt.Fprintf(tw, "Istio Proxy Version:\t%s\n", istioProxySha)
    Go
    - Registered: Wed May 08 22:53:08 GMT 2024
    - Last Modified: Thu Feb 29 20:46:41 GMT 2024
    - 7.4K bytes
    - Viewed (0)
  4. internal/s3select/select_benchmark_test.go

    	b := make([]byte, length)
    	for i := range b {
    		b[i] = charset[randSrc.Intn(len(charset))]
    	}
    	return string(b)
    }
    
    func genSampleCSVData(count int) []byte {
    	buf := &bytes.Buffer{}
    	csvWriter := csv.NewWriter(buf)
    	csvWriter.Write([]string{"id", "name", "age", "city"})
    
    	for i := 0; i < count; i++ {
    		csvWriter.Write([]string{
    			strconv.Itoa(i),
    			newRandString(10),
    			newRandString(5),
    			newRandString(10),
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Thu Apr 14 13:54:47 GMT 2022
    - 5K bytes
    - Viewed (0)
  5. src/archive/tar/writer.go

    	// err is a persistent error.
    	// It is only the responsibility of every exported method of Writer to
    	// ensure that this error is sticky.
    	err error
    }
    
    // NewWriter creates a new Writer writing to w.
    func NewWriter(w io.Writer) *Writer {
    	return &Writer{w: w, curr: &regFileWriter{w, 0}}
    }
    
    type fileWriter interface {
    	io.Writer
    	fileState
    
    	ReadFrom(io.Reader) (int64, error)
    }
    
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Fri Oct 13 18:36:46 GMT 2023
    - 19.6K bytes
    - Viewed (0)
  6. cmd/warm-backend-gcs.go

    func (gcs *warmBackendGCS) Put(ctx context.Context, key string, data io.Reader, length int64) (remoteVersionID, error) {
    	object := gcs.client.Bucket(gcs.Bucket).Object(gcs.getDest(key))
    	// TODO: set storage class
    	w := object.NewWriter(ctx)
    	if gcs.StorageClass != "" {
    		w.ObjectAttrs.StorageClass = gcs.StorageClass
    	}
    	if _, err := xioutil.Copy(w, data); err != nil {
    		return "", gcsToObjectError(err, gcs.Bucket, key)
    	}
    
    	return "", w.Close()
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Sun Apr 21 11:43:18 GMT 2024
    - 5.9K bytes
    - Viewed (0)
  7. android/guava-tests/test/com/google/common/io/CharSourceTest.java

          assertThrows(IOException.class, () -> okSource.copyTo(new TestCharSink(option)));
          // ensure reader was closed IF it was opened (depends on implementation whether or not it's
          // opened at all if sink.newWriter() throws).
          assertTrue(
              "stream not closed when copying to sink with option: " + option,
              !okSource.wasStreamOpened() || okSource.wasStreamClosed());
        }
      }
    
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 12K bytes
    - Viewed (0)
  8. guava-tests/test/com/google/common/io/CharSourceTest.java

          assertThrows(IOException.class, () -> okSource.copyTo(new TestCharSink(option)));
          // ensure reader was closed IF it was opened (depends on implementation whether or not it's
          // opened at all if sink.newWriter() throws).
          assertTrue(
              "stream not closed when copying to sink with option: " + option,
              !okSource.wasStreamOpened() || okSource.wasStreamClosed());
        }
      }
    
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 13K bytes
    - Viewed (0)
  9. internal/s3select/json/record.go

    				return err
    			}
    			columnValue = string(b)
    		default:
    			return fmt.Errorf("Cannot marshal unhandled type: %T", kv.Value)
    		}
    		csvRecord = append(csvRecord, columnValue)
    	}
    
    	w := csv.NewWriter(writer)
    	w.Comma = opts.FieldDelimiter
    	w.Quote = opts.Quote
    	w.AlwaysQuote = opts.AlwaysQuote
    	w.QuoteEscape = opts.QuoteEscape
    	if err := w.Write(csvRecord); err != nil {
    		return err
    	}
    	w.Flush()
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Fri Feb 25 20:31:19 GMT 2022
    - 5.2K bytes
    - Viewed (0)
  10. cmd/post-policy_test.go

    		"policy":                      encodedPolicy,
    		"signature":                   signature,
    		"X-Amz-Ignore-AWSAccessKeyId": "",
    	}
    
    	// Create the multipart form.
    	var buf bytes.Buffer
    	w := multipart.NewWriter(&buf)
    
    	// Set the normal formData
    	for k, v := range formData {
    		w.WriteField(k, v)
    	}
    	// Set the File formData
    	writer, err := w.CreateFormFile("file", "upload.txt")
    	if err != nil {
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Fri Apr 19 16:45:54 GMT 2024
    - 29.6K bytes
    - Viewed (0)
Back to top