_id
stringlengths
2
7
title
stringclasses
1 value
partition
stringclasses
3 values
text
stringlengths
6
2.61k
language
stringclasses
1 value
meta_information
dict
c8300
train
// huffSort will sort symbols, decreasing order.
{ "resource": "" }
c8301
train
// NewWriter creates a new Writer. // Writes to the returned Writer are compressed and written to w. // // It is the caller's responsibility to call Close on the WriteCloser when done. // Writes may be buffered and not flushed until Close.
{ "resource": "" }
c8302
train
// NewWriterLevel is like NewWriter but specifies the compression level instead // of assuming DefaultCompression. // // The compression level can be DefaultCompression, NoCompression, HuffmanOnly // or any integer value between BestSpeed and BestCompression inclusive. // The error returned will be nil if the level is ...
{ "resource": "" }
c8303
train
// NewWriterLevelDict is like NewWriterLevel but specifies a dictionary to // compress with. // // The dictionary may be nil. If not, its contents should not be modified until // the Writer is closed.
{ "resource": "" }
c8304
train
// Reset clears the state of the Writer z such that it is equivalent to its // initial state from NewWriterLevel or NewWriterLevelDict, but instead writing // to w.
{ "resource": "" }
c8305
train
// writeHeader writes the ZLIB header.
{ "resource": "" }
c8306
train
// Write writes a compressed form of p to the underlying io.Writer. The // compressed bytes are not necessarily flushed until the Writer is closed or // explicitly flushed.
{ "resource": "" }
c8307
train
// NewWriter returns a new Writer writing a zip file to w.
{ "resource": "" }
c8308
train
// SetOffset sets the offset of the beginning of the zip data within the // underlying writer. It should be used when the zip data is appended to an // existing file, such as a binary executable. // It must be called before any data is written.
{ "resource": "" }
c8309
train
// Flush flushes any buffered data to the underlying writer. // Calling Flush is not normally necessary; calling Close is sufficient.
{ "resource": "" }
c8310
train
// RegisterCompressor registers or overrides a custom compressor for a specific // method ID. If a compressor for a given method is not found, Writer will // default to looking up the compressor at the package level.
{ "resource": "" }
c8311
train
// estimateSize returns the estimated size in bytes of the input represented in the // histogram supplied.
{ "resource": "" }
c8312
train
// minSize returns the minimum possible size considering the shannon limit.
{ "resource": "" }
c8313
train
// decSymbolValue returns the transformed decSymbol for the given symbol.
{ "resource": "" }
c8314
train
// setRLE will set the decoder til RLE mode.
{ "resource": "" }
c8315
train
// transform will transform the decoder table into a table usable for // decoding without having to apply the transformation while decoding. // The state will contain the base value and the number of bits to read.
{ "resource": "" }
c8316
train
// Initialize and decodeAsync first state and symbol.
{ "resource": "" }
c8317
train
// next returns the current symbol and sets the next state. // At least tablelog bits must be available in the bit reader.
{ "resource": "" }
c8318
train
// final returns the current state symbol without decoding the next.
{ "resource": "" }
c8319
train
// NewReader creates a new ReadCloser. // Reads from the returned ReadCloser read and decompress data from r. // If r does not implement io.ByteReader, the decompressor may read more // data than necessary from r. // It is the caller's responsibility to call Close on the ReadCloser when done. // // The ReadCloser retur...
{ "resource": "" }
c8320
train
// NewReaderDict is like NewReader but uses a preset dictionary. // NewReaderDict ignores the dictionary if the compressed data does not refer to it. // If the compressed data refers to a different dictionary, NewReaderDict returns ErrDictionary. // // The ReadCloser returned by NewReaderDict also implements Resetter.
{ "resource": "" }
c8321
train
// Calling Close does not close the wrapped io.Reader originally passed to NewReader. // In order for the ZLIB checksum to be verified, the reader must be // fully consumed until the io.EOF.
{ "resource": "" }
c8322
train
// reset will reset the history to initial state of a frame. // The history must already have been initialized to the desired size.
{ "resource": "" }
c8323
train
// append bytes to history. // This function will make sure there is space for it, // if the buffer has been allocated with enough extra space.
{ "resource": "" }
c8324
train
// append bytes to history without ever discarding anything.
{ "resource": "" }
c8325
train
// Decompress1X will decompress a 1X encoded stream. // The length of the supplied input must match the end of a block exactly. // Before this is called, the table must be initialized with ReadTable unless // the encoder re-used the table.
{ "resource": "" }
c8326
train
// matches will compare a decoding table to a coding table. // Errors are written to the writer. // Nothing will be written if table is ok.
{ "resource": "" }
c8327
train
// Decompress a block of data. // You can provide a scratch buffer to avoid allocations. // If nil is provided a temporary one will be allocated. // It is possible, but by no way guaranteed that corrupt data will // return an error. // It is up to the caller to verify integrity of the returned data. // Use a predefined...
{ "resource": "" }
c8328
train
// allocDtable will allocate decoding tables if they are not big enough.
{ "resource": "" }
c8329
train
// decompress will decompress the bitstream. // If the buffer is over-read an error is returned.
{ "resource": "" }
c8330
train
// init will initialize the decoder and read the first state from the stream.
{ "resource": "" }
c8331
train
// next returns the next symbol and sets the next state. // At least tablelog bits must be available in the bit reader.
{ "resource": "" }
c8332
train
// next will start decoding the next block from stream.
{ "resource": "" }
c8333
train
// sendEOF will queue an error block on the frame. // This will cause the frame decoder to return when it encounters the block. // Returns true if the decoder was added.
{ "resource": "" }
c8334
train
// checkCRC will check the checksum if the frame has one. // Will return ErrCRCMismatch if crc check failed, otherwise nil.
{ "resource": "" }
c8335
train
// runDecoder will create a sync decoder that will decodeAsync a block of data.
{ "resource": "" }
c8336
train
// dynamicSize returns the size of dynamically encoded data in bits.
{ "resource": "" }
c8337
train
// fixedSize returns the size of dynamically encoded data in bits.
{ "resource": "" }
c8338
train
// storedSize calculates the stored size, including header. // The function returns the size in bits and whether the block // fits inside a single block.
{ "resource": "" }
c8339
train
// Write the header of a dynamic Huffman block to the output stream. // // numLiterals The number of literals specified in codegen // numOffsets The number of offsets specified in codegen // numCodegens The number of codegens used in codegen
{ "resource": "" }
c8340
train
// writeBlock will write a block of tokens with the smallest encoding. // The original input can be supplied, and if the huffman encoded data // is larger than the original bytes, the data will be written as a // stored block. // If the input is nil, the tokens will always be Huffman encoded.
{ "resource": "" }
c8341
train
// indexTokens indexes a slice of tokens, and updates // literalFreq and offsetFreq, and generates literalEncoding // and offsetEncoding. // The number of literal and offset tokens is returned.
{ "resource": "" }
c8342
train
// writeTokens writes a slice of tokens to the output. // codes for literal and offset encoding must be supplied.
{ "resource": "" }
c8343
train
// writeBlockHuff encodes a block of bytes as either // Huffman encoded literals or uncompressed bytes if the // results only gains very little from compression.
{ "resource": "" }
c8344
train
// OpenReader will open the Zip file specified by name and return a ReadCloser.
{ "resource": "" }
c8345
train
// NewReader returns a new Reader reading from r, which is assumed to // have the given size in bytes.
{ "resource": "" }
c8346
train
// RegisterDecompressor registers or overrides a custom decompressor for a // specific method ID. If a decompressor for a given method is not found, // Reader will default to looking up the decompressor at the package level. // // Must not be called concurrently with Open on any Files in the Reader.
{ "resource": "" }
c8347
train
// DataOffset returns the offset of the file's possibly-compressed // data, relative to the beginning of the zip file. // // Most callers should instead use Open, which transparently // decompresses data and verifies checksums.
{ "resource": "" }
c8348
train
// Open returns a ReadCloser that provides access to the File's contents. // Multiple files may be read concurrently.
{ "resource": "" }
c8349
train
// findBodyOffset does the minimum work to verify the file has a header // and returns the file body offset.
{ "resource": "" }
c8350
train
// readDirectory64End reads the zip64 directory end and updates the // directory end with the zip64 directory end values.
{ "resource": "" }
c8351
train
// FileInfoHeader creates a partially-populated FileHeader from an // os.FileInfo. // Because os.FileInfo's Name method returns only the base name of // the file it describes, it may be necessary to modify the Name field // of the returned header to provide the full path name of the file.
{ "resource": "" }
c8352
train
// ModTime returns the modification time in UTC. // The resolution is 2s.
{ "resource": "" }
c8353
train
// SetModTime sets the ModifiedTime and ModifiedDate fields to the given time in UTC. // The resolution is 2s.
{ "resource": "" }
c8354
train
// Mode returns the permission and mode bits for the FileHeader.
{ "resource": "" }
c8355
train
// SetMode changes the permission and mode bits for the FileHeader.
{ "resource": "" }
c8356
train
// isZip64 reports whether the file size exceeds the 32 bit limit
{ "resource": "" }
c8357
train
// set sets the code and length of an hcode.
{ "resource": "" }
c8358
train
// Generates a HuffmanCode corresponding to the fixed literal table
{ "resource": "" }
c8359
train
// Look at the leaves and assign them a bit count and an encoding as specified // in RFC 1951 3.2.2
{ "resource": "" }
c8360
train
// Returns the offset code corresponding to a specific offset
{ "resource": "" }
c8361
train
// init initializes dictDecoder to have a sliding window dictionary of the given // size. If a preset dict is provided, it will initialize the dictionary with // the contents of dict.
{ "resource": "" }
c8362
train
// histSize reports the total amount of historical data in the dictionary.
{ "resource": "" }
c8363
train
// readFlush returns a slice of the historical buffer that is ready to be // emitted to the user. The data returned by readFlush must be fully consumed // before calling any other dictDecoder methods.
{ "resource": "" }
c8364
train
// Reset the encoding table.
{ "resource": "" }
c8365
train
// WithDecoderLowmem will set whether to use a lower amount of memory, // but possibly have to allocate more while running.
{ "resource": "" }
c8366
train
// WithDecoderConcurrency will set the concurrency, // meaning the maximum number of decoders to run concurrently. // The value supplied must be at least 1. // By default this will be set to GOMAXPROCS.
{ "resource": "" }
c8367
train
// HistogramFinished can be called to indicate that the histogram has been populated. // maxSymbol is the index of the highest set symbol of the next data segment. // maxCount is the number of entries in the most populated entry. // These are accepted at face value.
{ "resource": "" }
c8368
train
// prepare will prepare and allocate scratch tables used for both compression and decompression.
{ "resource": "" }
c8369
train
// Estimate returns a normalized compressibility estimate of block b. // Values close to zero are likely uncompressible. // Values above 0.1 are likely to be compressible. // Values above 0.5 are very compressible. // Very small lengths will return 0.
{ "resource": "" }
c8370
train
// init will initialize the reader and set the input.
{ "resource": "" }
c8371
train
// Uint8 returns the next byte
{ "resource": "" }
c8372
train
// Copy a single uncompressed data block from input to output.
{ "resource": "" }
c8373
train
// copyData copies f.copyLen bytes from the underlying reader into f.hist. // It pauses for reads when f.hist is full.
{ "resource": "" }
c8374
train
// noEOF returns err, unless err == io.EOF, in which case it returns io.ErrUnexpectedEOF.
{ "resource": "" }
c8375
train
// Read the next Huffman-encoded symbol from f according to h.
{ "resource": "" }
c8376
train
// NewReader returns a new ReadCloser that can be used // to read the uncompressed version of r. // If r does not also implement io.ByteReader, // 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 ReadClose...
{ "resource": "" }
c8377
train
// fillBase will precalculate base offsets with the given bit distributions.
{ "resource": "" }
c8378
train
// Compress the input bytes. Input must be < 2GB. // Provide a Scratch buffer to avoid memory allocations. // Note that the output is also kept in the scratch buffer. // If input is too hard to compress, ErrIncompressible is returned. // If input is a single byte value repeated ErrUseRLE is returned.
{ "resource": "" }
c8379
train
// init will initialize the compression state to the first symbol of the stream.
{ "resource": "" }
c8380
train
// flush will write the tablelog to the output and flush the remaining full bytes.
{ "resource": "" }
c8381
train
// String prints values as a human readable string.
{ "resource": "" }
c8382
train
// allocCtable will allocate tables needed for compression. // If existing tables a re big enough, they are simply re-used.
{ "resource": "" }
c8383
train
// normalizeCount will normalize the count of the symbols so // the total is equal to the table size.
{ "resource": "" }
c8384
train
// validateNorm validates the normalized histogram table.
{ "resource": "" }
c8385
train
// Read bytes from the decompressed stream into p. // Returns the number of bytes written and any error that occurred. // When the stream is done, io.EOF will be returned.
{ "resource": "" }
c8386
train
// Reset will reset the decoder the supplied stream after the current has finished processing. // Note that this functionality cannot be used after Close has been called.
{ "resource": "" }
c8387
train
// drainOutput will drain the output until errEndOfStream is sent.
{ "resource": "" }
c8388
train
// WriteTo writes data to w until there's no more data to write or when an error occurs. // The return value n is the number of bytes written. // Any error encountered during the write is also returned.
{ "resource": "" }
c8389
train
// DecodeAll allows stateless decoding of a blob of bytes. // Output will be appended to dst, so if the destination size is known // you can pre-allocate the destination slice to avoid allocations. // DecodeAll can be used concurrently. // The Decoder concurrency limits will be respected.
{ "resource": "" }
c8390
train
// nextBlock returns the next block. // If an error occurs d.err will be set.
{ "resource": "" }
c8391
train
// Close will release all resources. // It is NOT possible to reuse the decoder after this.
{ "resource": "" }
c8392
train
// start conditional rendering
{ "resource": "" }
c8393
train
// bind a user-defined varying out variable to a fragment shader color number
{ "resource": "" }
c8394
train
// specify whether data read via should be clamped
{ "resource": "" }
c8395
train
// define a color lookup table
{ "resource": "" }
c8396
train
// define a one-dimensional convolution filter
{ "resource": "" }
c8397
train
// define a two-dimensional convolution filter
{ "resource": "" }
c8398
train
// copy pixels into a color table
{ "resource": "" }
c8399
train
// copy pixels into a one-dimensional convolution filter
{ "resource": "" }