InputStream myFileStream=con.retrieveFileStream("H1.txt");
FTP 이용해서 파일 다운받는 부분인데요
myFileStream 이라는 값을 바이트형식으로 사이즈를 알수있을까요?
con.listFiles("H1.txt")를 하시면 FTPFile 배열이 리턴됩니다.
이제 FTPFile.getSize() 메소드를 쓰시면 되겠네요.
문서
http://commons.apache.org/net/apidocs/org/apache/commons/net/ftp/FTPClient.html#listFiles%28java.lang.String%29
http://commons.apache.org/net/apidocs/org/apache/commons/net/ftp/FTPFile.html#getSize%28%29
정말 감사합니다.
InputStream의 read 메소드를 이용하면 byte 배열에 넣으면서 몇 byte를 읽었는지 리턴합니다..그걸 활용하세요..
로그인 유지
con.listFiles("H1.txt")를 하시면 FTPFile 배열이 리턴됩니다.
이제 FTPFile.getSize() 메소드를 쓰시면 되겠네요.
문서
http://commons.apache.org/net/apidocs/org/apache/commons/net/ftp/FTPClient.html#listFiles%28java.lang.String%29
http://commons.apache.org/net/apidocs/org/apache/commons/net/ftp/FTPFile.html#getSize%28%29