code: private void pp20DoUnpack(RandomAccessInputStream source, byte [] buffer) throws IOException
  	{
  		BitBuffer bitBuffer = new BitBuffer(source, (int)source.getLength()-4);
  		source.seek(source.getLength()-1);
  		int skip = source.read();
  		bitBuffer.getBits(skip);
  		int nBytesLeft = buffer.length;
  		while (nBytesLeft > 0)
  		{
  			if (bitBuffer.getBits(1) == 0)
  			{
  				int n = 1;
  				while (n < nBytesLeft)
  				{
  					int code = (int)bitBuffer.getBits(2);
  					n += code;
  					if (code != 3) break;
  				}
  				for (int i=0; i<n; i++)
  				{
  					buffer[--nBytesLeft] = (byte)bitBuffer.getBits(8);
  				}
  				if (nBytesLeft == 0) break;
  			}
  			
  			int n = bitBuffer.getBits(2)+1;
  			source.seek(n+3);
  			int nbits = source.read();
  			int nofs;
  			if (n==4)
  			{
  				nofs = bitBuffer.getBits( (bitBuffer.getBits(1)!=0) ? nbits : 7 );
  				while (n < nBytesLeft)
  				{
  					int code = bitBuffer.getBits(3);
  					n += code;
  					if (code != 7) break;
  				}
  			} 
  			else
  			{
  				nofs = bitBuffer.getBits(nbits);
  			}
  			for (int i=0; i<=n; i++)
  			{
  				buffer[nBytesLeft-1] = (nBytesLeft+nofs < buffer.length) ? buffer[nBytesLeft+nofs] : 0;
  				if ((--nBytesLeft)==0) break;
  			}
  		}
  	}
docs: Will unpack powerpacker 2.0 packed contend while reading from the packed Stream
  and unpacking into memory
  @since 06.01.2010
  @param source
  @param buffer
  @throws IOException