I spent a while to sort out some integer results of the bzdecompress, so maybe it'll be useful for somebody else also...
(Constants from the sources.)
#define BZ_OK 0
#define BZ_RUN_OK 1
#define BZ_FLUSH_OK 2
#define BZ_FINISH_OK 3
#define BZ_STREAM_END 4
#define BZ_SEQUENCE_ERROR (-1)
#define BZ_PARAM_ERROR (-2)
#define BZ_MEM_ERROR (-3)
#define BZ_DATA_ERROR (-4)
#define BZ_DATA_ERROR_MAGIC (-5)
#define BZ_IO_ERROR (-6)
#define BZ_UNEXPECTED_EOF (-7)
#define BZ_OUTBUFF_FULL (-8)
#define BZ_CONFIG_ERROR (-9)
bzdecompress
(PHP 4 >= 4.3.3, PHP 5, PECL bz2:1.0)
bzdecompress — bzip2 인코딩 데이터의 압축을 해제한다
설명
string bzdecompress
( string $source
[, int $small
] )
bzdecompress()는 bzip2 인코딩 데이터를 포함하는 source 문자열의 압축을 해제하고 반환한다. 선택적인 매개변수 small 이 TRUE이면, 메모리를 더 적게 사용하는 대체 압축 해제 알고리즘이 사용될것이다 (최대 메모리 요구량은 2300K 이하이다). 그러나 속도는 반으로 줄게 된다.이 기능에 대해 더많은 정보를 얻으려면 » bzip2 문서를 참고한다.
Example#1 bzdecompress()
<?php
$start_str = "This is not an honest face?";
$bzstr = bzcompress($start_str);
print( "압축 문자열: " );
print( $bzstr );
print( "\n<br>\n" );
$str = bzdecompress($bzstr);
print( "압축 해제된 문자열: " );
print( $str );
print( "\n<br>\n" );
?>
bzcompress() 참고.
bzdecompress
balint * atres / ath / cx
10-Jan-2006 05:02
10-Jan-2006 05:02
