형들 JSP에서 파일 다운로드 소스를 돌렸는데 파일에 공백이 존나 들어감
Lowforc..(lowforce)
2016-01-22 21:07
추천 0
대충 요런 소스였는데 ;;전부다 긁은건아니니 너그러이좀..
StringBuffer sb
= new StringBuffer("whatever string you like");
InputStream in
= new ByteArrayInputStream(sb
.toString().getBytes("UTF-8"));
ServletOutputStream out
= response
.getOutputStream();
byte[] outputByte
= new byte[4096];
while(in
.read(outputByte
, 0, 4096) != -1)
{
out
.write(outputByte
, 0, 4096);
}
in
.close();
out
.flush();
out
.close();jsp로 클래스 실행시키고 파일 정보 여는거까진 OK인데
파일 다운로드 떠서 열어보면
공백이 엄청 추가되있는데 어느시점에서 추가 되는건지 확인할 방법 없을까?
파일내용이
-----------------------start
aaaaaaaaaaaa
aaaaaaaaaaaa
aaaaaaaaaaaa
aaaaaaaaaaaa
aaaaaaaaaaaa
-----------------------end
요렇게 있다고하면
이렇게 출력됨
-----------------------start
<!-- 뭔가 jsp파일 위쪽의 이런 주석도 출력됨 -->
aaaaaaaaaaaa
aaaaaaaaaaaa
-----------------------end
시발...
댓글 0