summaryrefslogtreecommitdiff
path: root/devdocs/go/compress%2Flzw%2Findex.html
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2024-04-07 13:41:34 -0500
committerCraig Jennings <c@cjennings.net>2024-04-07 13:41:34 -0500
commit754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 (patch)
treef1190704f78f04a2b0b4c977d20fe96a828377f1 /devdocs/go/compress%2Flzw%2Findex.html
new repository
Diffstat (limited to 'devdocs/go/compress%2Flzw%2Findex.html')
-rw-r--r--devdocs/go/compress%2Flzw%2Findex.html54
1 files changed, 54 insertions, 0 deletions
diff --git a/devdocs/go/compress%2Flzw%2Findex.html b/devdocs/go/compress%2Flzw%2Findex.html
new file mode 100644
index 00000000..fd2df20e
--- /dev/null
+++ b/devdocs/go/compress%2Flzw%2Findex.html
@@ -0,0 +1,54 @@
+<h1> Package lzw </h1> <ul id="short-nav">
+<li><code>import "compress/lzw"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package lzw implements the Lempel-Ziv-Welch compressed data format, described in T. A. Welch, “A Technique for High-Performance Data Compression”, Computer, 17(6) (June 1984), pp 8-19. </p>
+<p>In particular, it implements LZW as used by the GIF and PDF file formats, which means variable-width codes up to 12 bits and the first two non-literal codes are a clear code and an EOF code. </p>
+<p>The TIFF file format uses a similar but incompatible version of the LZW algorithm. See the golang.org/x/image/tiff/lzw package for an implementation. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#NewReader">func NewReader(r io.Reader, order Order, litWidth int) io.ReadCloser</a></li>
+<li><a href="#NewWriter">func NewWriter(w io.Writer, order Order, litWidth int) io.WriteCloser</a></li>
+<li><a href="#Order">type Order</a></li>
+<li><a href="#Reader">type Reader</a></li>
+<li> <a href="#Reader.Close">func (r *Reader) Close() error</a>
+</li>
+<li> <a href="#Reader.Read">func (r *Reader) Read(b []byte) (int, error)</a>
+</li>
+<li> <a href="#Reader.Reset">func (r *Reader) Reset(src io.Reader, order Order, litWidth int)</a>
+</li>
+<li><a href="#Writer">type Writer</a></li>
+<li> <a href="#Writer.Close">func (w *Writer) Close() error</a>
+</li>
+<li> <a href="#Writer.Reset">func (w *Writer) Reset(dst io.Writer, order Order, litWidth int)</a>
+</li>
+<li> <a href="#Writer.Write">func (w *Writer) Write(p []byte) (n int, err error)</a>
+</li>
+</ul> <h3>Package files</h3> <p> <span>reader.go</span> <span>writer.go</span> </p> <h2 id="NewReader">func <span>NewReader</span> </h2> <pre data-language="go">func NewReader(r io.Reader, order Order, litWidth int) io.ReadCloser</pre> <p>NewReader creates a new <span>io.ReadCloser</span>. Reads from the returned <span>io.ReadCloser</span> read and decompress data from r. If r does not also implement <span>io.ByteReader</span>, the decompressor may read more data than necessary from r. It is the caller's responsibility to call Close on the ReadCloser when finished reading. The number of bits to use for literal codes, litWidth, must be in the range [2,8] and is typically 8. It must equal the litWidth used during compression. </p>
+<p>It is guaranteed that the underlying type of the returned <span>io.ReadCloser</span> is a *<a href="#Reader">Reader</a>. </p>
+<h2 id="NewWriter">func <span>NewWriter</span> </h2> <pre data-language="go">func NewWriter(w io.Writer, order Order, litWidth int) io.WriteCloser</pre> <p>NewWriter creates a new <span>io.WriteCloser</span>. Writes to the returned <span>io.WriteCloser</span> are compressed and written to w. It is the caller's responsibility to call Close on the WriteCloser when finished writing. The number of bits to use for literal codes, litWidth, must be in the range [2,8] and is typically 8. Input bytes must be less than 1&lt;&lt;litWidth. </p>
+<p>It is guaranteed that the underlying type of the returned <span>io.WriteCloser</span> is a *<a href="#Writer">Writer</a>. </p>
+<h2 id="Order">type <span>Order</span> </h2> <p>Order specifies the bit ordering in an LZW data stream. </p>
+<pre data-language="go">type Order int</pre> <pre data-language="go">const (
+ // LSB means Least Significant Bits first, as used in the GIF file format.
+ LSB Order = iota
+ // MSB means Most Significant Bits first, as used in the TIFF and PDF
+ // file formats.
+ MSB
+)</pre> <h2 id="Reader">type <span>Reader</span> <span title="Added in Go 1.17">1.17</span> </h2> <p>Reader is an io.Reader which can be used to read compressed data in the LZW format. </p>
+<pre data-language="go">type Reader struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="Reader.Close">func (*Reader) <span>Close</span> <span title="Added in Go 1.17">1.17</span> </h3> <pre data-language="go">func (r *Reader) Close() error</pre> <p>Close closes the <a href="#Reader">Reader</a> and returns an error for any future read operation. It does not close the underlying <span>io.Reader</span>. </p>
+<h3 id="Reader.Read">func (*Reader) <span>Read</span> <span title="Added in Go 1.17">1.17</span> </h3> <pre data-language="go">func (r *Reader) Read(b []byte) (int, error)</pre> <p>Read implements io.Reader, reading uncompressed bytes from its underlying <a href="#Reader">Reader</a>. </p>
+<h3 id="Reader.Reset">func (*Reader) <span>Reset</span> <span title="Added in Go 1.17">1.17</span> </h3> <pre data-language="go">func (r *Reader) Reset(src io.Reader, order Order, litWidth int)</pre> <p>Reset clears the <a href="#Reader">Reader</a>'s state and allows it to be reused again as a new <a href="#Reader">Reader</a>. </p>
+<h2 id="Writer">type <span>Writer</span> <span title="Added in Go 1.17">1.17</span> </h2> <p>Writer is an LZW compressor. It writes the compressed form of the data to an underlying writer (see <a href="#NewWriter">NewWriter</a>). </p>
+<pre data-language="go">type Writer struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="Writer.Close">func (*Writer) <span>Close</span> <span title="Added in Go 1.17">1.17</span> </h3> <pre data-language="go">func (w *Writer) Close() error</pre> <p>Close closes the <a href="#Writer">Writer</a>, flushing any pending output. It does not close w's underlying writer. </p>
+<h3 id="Writer.Reset">func (*Writer) <span>Reset</span> <span title="Added in Go 1.17">1.17</span> </h3> <pre data-language="go">func (w *Writer) Reset(dst io.Writer, order Order, litWidth int)</pre> <p>Reset clears the <a href="#Writer">Writer</a>'s state and allows it to be reused again as a new <a href="#Writer">Writer</a>. </p>
+<h3 id="Writer.Write">func (*Writer) <span>Write</span> <span title="Added in Go 1.17">1.17</span> </h3> <pre data-language="go">func (w *Writer) Write(p []byte) (n int, err error)</pre> <p>Write writes a compressed representation of p to w's underlying writer. </p><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/compress/lzw/" class="_attribution-link">http://golang.org/pkg/compress/lzw/</a>
+ </p>
+</div>