Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 8 of 8 for NewWriterDict (0.18 sec)

  1. src/compress/flate/deflate.go

    	}
    	return &dw, nil
    }
    
    // NewWriterDict is like [NewWriter] but initializes the new
    // [Writer] with a preset dictionary. The returned [Writer] behaves
    // as if the dictionary had been written to it without producing
    // any compressed output. The compressed data written to w
    // can only be decompressed by a [Reader] initialized with the
    // same dictionary.
    func NewWriterDict(w io.Writer, level int, dict []byte) (*Writer, error) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Apr 26 13:32:40 UTC 2024
    - 20.3K bytes
    - Viewed (0)
  2. src/compress/flate/inflate_test.go

    	dict := []byte("the lorem fox")
    	ss := []string{
    		"lorem ipsum izzle fo rizzle",
    		"the quick brown fox jumped over",
    	}
    
    	deflated := make([]bytes.Buffer, len(ss))
    	for i, s := range ss {
    		w, _ := NewWriterDict(&deflated[i], DefaultCompression, dict)
    		w.Write([]byte(s))
    		w.Close()
    	}
    
    	inflated := make([]bytes.Buffer, len(ss))
    
    	f := NewReader(nil)
    	for i := range inflated {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 24 23:23:54 UTC 2023
    - 3.3K bytes
    - Viewed (0)
  3. src/compress/zlib/writer.go

    			return err
    		}
    	}
    	if z.compressor == nil {
    		// Initialize deflater unless the Writer is being reused
    		// after a Reset call.
    		z.compressor, err = flate.NewWriterDict(z.w, z.level, z.dict)
    		if err != nil {
    			return err
    		}
    		z.digest = adler32.New()
    	}
    	return nil
    }
    
    // Write writes a compressed form of p to the underlying io.Writer. The
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Feb 27 18:51:27 UTC 2023
    - 5.2K bytes
    - Viewed (0)
  4. src/compress/flate/example_test.go

    	<meta name="isbn" content="978-0134190440"/>
    	<data>...</data>
    </book>
    `
    
    	var b bytes.Buffer
    
    	// Compress the data using the specially crafted dictionary.
    	zw, err := flate.NewWriterDict(&b, flate.DefaultCompression, []byte(dict))
    	if err != nil {
    		log.Fatal(err)
    	}
    	if _, err := io.Copy(zw, strings.NewReader(data)); err != nil {
    		log.Fatal(err)
    	}
    	if err := zw.Close(); err != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sat Nov 12 18:42:35 UTC 2016
    - 6.5K bytes
    - Viewed (0)
  5. src/compress/flate/deflate_test.go

    	if err != nil {
    		t.Fatalf("NewWriter: %v", err)
    	}
    	w.Write([]byte(dict))
    	w.Flush()
    	b.Reset()
    	w.Write([]byte(text))
    	w.Close()
    
    	var b1 bytes.Buffer
    	w, _ = NewWriterDict(&b1, 5, []byte(dict))
    	w.Write([]byte(text))
    	w.Close()
    
    	if !bytes.Equal(b1.Bytes(), b.Bytes()) {
    		t.Fatalf("writer wrote %q want %q", b1.Bytes(), b.Bytes())
    	}
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jun 14 00:03:57 UTC 2023
    - 25.6K bytes
    - Viewed (0)
  6. src/compress/flate/inflate.go

    // with a preset dictionary. The returned [Reader] behaves as if
    // the uncompressed data stream started with the given dictionary,
    // which has already been read. NewReaderDict is typically used
    // to read data compressed by NewWriterDict.
    //
    // The ReadCloser returned by NewReaderDict also implements [Resetter].
    func NewReaderDict(r io.Reader, dict []byte) io.ReadCloser {
    	fixedHuffmanDecoderInit()
    
    	var f decompressor
    	f.makeReader(r)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Oct 13 23:20:03 UTC 2023
    - 20.4K bytes
    - Viewed (0)
  7. src/cmd/vendor/golang.org/x/tools/internal/stdlib/manifest.go

    		{"DefaultCompression", Const, 0},
    		{"HuffmanOnly", Const, 7},
    		{"InternalError", Type, 0},
    		{"NewReader", Func, 0},
    		{"NewReaderDict", Func, 0},
    		{"NewWriter", Func, 0},
    		{"NewWriterDict", Func, 0},
    		{"NoCompression", Const, 0},
    		{"ReadError", Type, 0},
    		{"ReadError.Err", Field, 0},
    		{"ReadError.Offset", Field, 0},
    		{"Reader", Type, 0},
    		{"Resetter", Type, 4},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 02 02:20:05 UTC 2024
    - 534.2K bytes
    - Viewed (0)
  8. api/go1.txt

    pkg compress/flate, func NewReader(io.Reader) io.ReadCloser
    pkg compress/flate, func NewReaderDict(io.Reader, []uint8) io.ReadCloser
    pkg compress/flate, func NewWriter(io.Writer, int) (*Writer, error)
    pkg compress/flate, func NewWriterDict(io.Writer, int, []uint8) (*Writer, error)
    pkg compress/flate, method (*ReadError) Error() string
    pkg compress/flate, method (*WriteError) Error() string
    pkg compress/flate, method (*Writer) Close() error
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Aug 14 18:58:28 UTC 2013
    - 1.7M bytes
    - Viewed (0)
Back to top