|
response.write("aaaaaaaaaaaa")
했을대.. 실제로 "문자열"이 엄청 많다고 가정하고.
이걸 gzip로 압축된 문자열로 내보내는 명령이 무엇인가요?
response.write("aaa")이라고 해서 콘솔에서 웹서버에 연결해 호출해보면 전혀 압축되어 지지 않고 리턴이 됩니다.
jsp를 보면
void sendHTML( HttpServletResponse response , String zipHTML ) {
ServletOutputStream svrOut = null ;
BufferedOutputStream outStream = null ;
GZIPOutputStream zipStream = null ;
try {
response.setHeader("Content-Encoding","gzip");
svrOut = response.getOutputStream();
outStream = new BufferedOutputStream( svrOut );
zipStream = new GZIPOutputStream( outStream ) ;
byte[] zipHTMLArray = zipHTML.getBytes();
zipStream.write( zipHTMLArray, 0, zipHTMLArray.length );
zipStream.flush();
} catch( Exception writeException ) {
writeException.printStackTrace();
} finally {
try {
if ( zipStream != null ) zipStream.close();
} catch( Exception closeException ) {
closeException.printStackTrace();
}
}
}
해서 압축하여 출력할수가 있는데.. asp.net에는 이렇게 하는 방법이 없는지요?
아무리 찾아도... 찾지를 못했습니다...
asp.net 2.0에 Imports System.IO.Compression 을 사용하면 되다는데. 이거는 도무지 파일을 압축하는 소스 밖에는 못 찾겠내요..
response.write 할때 값을 압출하는 방법을 즉..(text)를 바로 압축하여 string변수에 담을수 있는 방법을 가르쳐 주세요^^
|