Decodes a FullRevision operation.

@param blockSize_L
length of a L block
@return DiffPart, FullRevision

@throws UnsupportedEncodingException
if the character encoding is unsupported
@throws DecodingException
if the decoding failed
548424
private DiffPart decodeFullRevision(final int blockSize_L)
		throws UnsupportedEncodingException, DecodingException
	{

		if (blockSize_L < 1) {
			throw new DecodingException("Invalid value for blockSize_L: "
					+ blockSize_L);
		}

		int l = r.read(blockSize_L);

		ByteArrayOutputStream output = new ByteArrayOutputStream();
		for (int i = 0; i < l; i++) {
			output.write(r.readByte());
		}
		DiffPart part = new DiffPart(DiffAction.FULL_REVISION_UNCOMPRESSED);
		part.setText(output.toString(WIKIPEDIA_ENCODING));

		return part;
	}
858417
public static boolean decodeBoolean(byte[] src, int srcOffset)
        throws CorruptEncodingException
    {
        try {
            return src[srcOffset] == (byte)128;
        } catch (IndexOutOfBoundsException e) {
            throw new CorruptEncodingException(null, e);
        }
    }
1103768
private void encodeFullRevisionUncompressed(final DiffPart part)
		throws UnsupportedEncodingException, EncodingException
	{

		// C
		data.writeBit(0);
		data.writeBit(0);
		data.writeBit(1);

		// L T
		String text = part.getText();
		byte[] bText = text.getBytes(WIKIPEDIA_ENCODING);

		data.writeValue(codecData.getBlocksizeL(), bText.length);
		data.write(bText);

	}
961999
public SequenceGenerator.SequenceBlock allocateBlock(int blockSize) {
        final long l = this.last;
        SequenceGenerator.SequenceBlock block =
                new SequenceGenerator.SequenceBlock(l + 1, l + blockSize);
        this.last = l + blockSize;

        return block;
    }
833496
public static int decompressOneBlock(int[] outBlock, int[] inBlock,
                int blockSize) {
                int[] expAux = new int[blockSize * 2];

                int expNum = inBlock[0] & 0x3ff;
                int bits = (inBlock[0] >>> 10) & (0x1f);

                // decompress the b-bit slots
                int offset = HEADER_SIZE;
                int compressedBits = 0;
                if (bits == 0) {
                        Arrays.fill(outBlock, 0);
                } else {
                        compressedBits = decompressBBitSlots(outBlock, inBlock,
                                blockSize, bits);
                        // Note that blocksize must be ==128 in order to use
                        // decompressBBitSlotsWithHardCodes
                        // compressedBits =
                        // decompressBBitSlotsWithHardCodes(outBlock, inBlock,
                        // blockSize, bits);
                }
                offset += compressedBits;

                // decompress exceptions
                if (expNum > 0) {
                        compressedBits = decompressBlockByS16(expAux, inBlock,
                                offset, expNum * 2);
                        offset += compressedBits;

                        for (int i = 0; i < expNum; i++) {
                                int curExpPos = expAux[i];
                                int curHighBits = expAux[i + expNum];
                                outBlock[curExpPos] = (outBlock[curExpPos] & MASK[bits])
                                        | ((curHighBits & MASK[32 - bits]) << bits);
                        }
                }
                return offset;
        }
1117412
private void deserializeSupplementary(byte[] descriptor) throws IOException {
        // for now, only recognize one supplementary descriptor
        if (this.hasSupplementary) {
            return;
        }

        validateBlockSize(descriptor);

        String escapeSequences = Util.getDChars(descriptor, 89, 32);

        String enc = getEncoding(escapeSequences);

        if (null != enc) {
            this.encoding = enc;
            this.escapeSequences = escapeSequences;

            deserializeCommon(descriptor);

            this.hasSupplementary = true;
        } else {
            log.warn("Unsupported encoding, escapeSequences: '" + this.escapeSequences + "'");
        }
    }
641655
function BlockDecoder(opts) {
  opts = opts || {};

  var noDecode = !!opts.noDecode;
  stream.Duplex.call(this, {
    allowHalfOpen: true, // For async decompressors.
    readableObjectMode: !noDecode
  });

  this._type = null;
  this._codecs = opts.codecs;
  this._parseHook = opts.parseHook;
  this._tap = new Tap(new Buffer(0));
  this._blockTap = new Tap(new Buffer(0));
  this._syncMarker = null;
  this._readValue = null;
  this._noDecode = noDecode;
  this._queue = new utils.OrderedQueue();
  this._decompress = null; // Decompression function.
  this._index = 0; // Next block index.
  this._needPush = false;
  this._finished = false;

  this.on('finish', function () {
    this._finished = true;
    if (this._needPush) {
      this._read();
    }
  });
}
48515
public int fullBlockSamplesAvailableToEncode() {
    int available = 0;
    int channels = streamConfig.getChannelCount();
    for(BlockEncodeRequest ber : preparedRequests) {
      int[] block = ber.samples;
      available += block.length/channels;
    }
    return available;
  }
64766
private int decodeNextBWTByte() {
        int mergedPointer = bwtCurrentMergedPointer;
        int nextDecodedByte =  mergedPointer & 0xff;
        bwtCurrentMergedPointer = bwtMergedPointers[mergedPointer >>> 8];

        if (blockRandomised) {
            if (--randomCount == 0) {
                nextDecodedByte ^= 1;
                randomIndex = (randomIndex + 1) % 512;
                randomCount = Bzip2Rand.rNums(randomIndex);
            }
        }
        bwtBytesDecoded++;

        return nextDecodedByte;
    }
132206
public static long getPosFromBlockOffset(long offsetInBlock, int bytesPerChecksum,
      int checksumSize) {
    // We only support to read full chunks, so offsetInBlock must be the boundary
    // of the chunks.
    assert offsetInBlock % bytesPerChecksum == 0;
    // The position in the file will be the same as the file size for the block
    // size.
    return getFileLengthFromBlockSize(offsetInBlock, bytesPerChecksum, checksumSize);
  }
187791
public Diff decode()
		throws UnsupportedEncodingException, DecodingException
	{

		int header = r.read(3);
		if (DiffAction.parse(header) != DiffAction.DECODER_DATA) {

			throw new DecodingException("Invalid codecData code: " + header);
		}

		int blockSize_C = 3;
		int blockSize_S = r.read(5);
		int blockSize_E = r.read(5);
		int blockSize_B = r.read(5);
		int blockSize_L = r.read(5);
		r.read(1);

		if (blockSize_S < 0 || blockSize_S > 31) {
			throw new DecodingException("blockSize_S out of range: "
					+ blockSize_S);
		}
		if (blockSize_E < 0 || blockSize_E > 31) {
			throw new DecodingException("blockSize_E out of range: "
					+ blockSize_E);
		}
		if (blockSize_B < 0 || blockSize_B > 31) {
			throw new DecodingException("blockSize_B out of range: "
					+ blockSize_B);
		}
		if (blockSize_L < 0 || blockSize_L > 31) {
			throw new DecodingException("blockSize_L out of range: "
					+ blockSize_L);
		}

		return decode(blockSize_C, blockSize_S, blockSize_E, blockSize_B,
				blockSize_L);
	}
41654
public static Byte decodeByteObjDesc(byte[] src, int srcOffset)
        throws CorruptEncodingException
    {
        try {
            int b = src[srcOffset];
            if (b == NULL_BYTE_HIGH || b == NULL_BYTE_LOW) {
                return null;
            }
            return decodeByteDesc(src, srcOffset + 1);
        } catch (IndexOutOfBoundsException e) {
            throw new CorruptEncodingException(null, e);
        }
    }
496821
public int decode(final InputStream stream, final ByteBuffer buffer) throws IOException {
        while (buffer.remaining() >= 64) {
            int val = stream.read();
            if (val < 0) {
                break; // EOF
            }

            if ((val & COMPRESSED_RUN_MASK) == COMPRESSED_RUN_MASK) {
                int count = val & ~COMPRESSED_RUN_MASK;

                int pixel = stream.read();
                if (pixel < 0) {
                    break; // EOF
                }

                for (int i = 0; i < count; i++) {
                    buffer.put((byte) pixel);
                }
            }
            else {
                buffer.put((byte) val);
            }
        }

        return buffer.position();
    }
1124048
public T decode(final BitInputStream in) throws IOException {
    Bits remainder = in.readAhead(0);
    Entry<Bits, T> entry = this.forwardIndex.floorEntry(remainder);
    while (entry == null || !remainder.startsWith(entry.getKey())) {
      remainder = in.readAhead();
      entry = this.forwardIndex.floorEntry(remainder);
    }
    in.read(entry.getKey().bitLength);
    return entry.getValue();
  }
834912
public static byte[] decode(final byte[] compressed) throws IOException {
        ByteArrayInputStream byteIn = new ByteArrayInputStream(compressed);
        ByteArrayOutputStream byteOut = new ByteArrayOutputStream();
        GZIPInputStream gzIn = null;
        try {
            gzIn = new GZIPInputStream(byteIn);
            int read;
            byte[] buffer = new byte[BUFFER_SIZE];
            do {
                read = gzIn.read(buffer);
                if (read > 0) {
                    byteOut.write(buffer, 0, read);
                }
            } while (read >= 0);
            return byteOut.toByteArray();
        } finally {
            gzIn.close();
            byteOut.close();
        }
    }
559908
public static int decodeTo(final byte[] output, int outOffset, 
            final String str, int inOffset, final int inLen)
    {
        if(inLen == 0)
            return 0;
        
        if (inLen%4!=0)
            throw new IllegalArgumentException("Input block size is not 4");

        int withoutPaddingLen = inLen, limit = inOffset + inLen;
        while (str.charAt(--limit)==pad)
            withoutPaddingLen--;

        // Create result array of exact required size.
        final int outLen=((withoutPaddingLen)*3)/4;
        //assert (output.length - outOffset) >= outLen;
        
        decode(str, inOffset, inLen, output, outOffset, outLen);

        return outLen;
    }
532650
public static double decodeDouble(byte[] src, int srcOffset)
        throws CorruptEncodingException
    {
        long bits = decodeDoubleBits(src, srcOffset);
        bits ^= (bits < 0) ? 0x8000000000000000L : 0xffffffffffffffffL;
        return Double.longBitsToDouble(bits);
    }