572 |
* @return the number of bytes written to the buffer, 0 if no further |
* @return the number of bytes written to the buffer, 0 if no further |
573 |
* output can be produced. |
* output can be produced. |
574 |
* @exception DataFormatException if deflated stream is invalid. |
* @exception DataFormatException if deflated stream is invalid. |
|
* @exception IllegalArgumentException if len is lt;eq; 0. |
|
575 |
* @exception IndexOutOfBoundsException if the off and/or len are wrong. |
* @exception IndexOutOfBoundsException if the off and/or len are wrong. |
576 |
*/ |
*/ |
577 |
public int inflate(byte[] buf, int off, int len) throws DataFormatException |
public int inflate(byte[] buf, int off, int len) throws DataFormatException |
578 |
{ |
{ |
579 |
if (len <= 0) |
/* Special case: len may be zero */ |
580 |
throw new IllegalArgumentException("len <= 0"); |
if (len == 0) |
581 |
|
return 0; |
582 |
|
/* Check for correct buff, off, len triple */ |
583 |
|
if (0 > off || off > off + len || off + len > buf.length) |
584 |
|
throw new ArrayIndexOutOfBoundsException(); |
585 |
int count = 0; |
int count = 0; |
586 |
int more; |
int more; |
587 |
do |
do |