aspose file tools*
The moose likes Sockets and Internet Protocols and the fly likes Transfer file by socket Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "Transfer file by socket" Watch "Transfer file by socket" New topic
Author

Transfer file by socket

Ivan Silva
Greenhorn

Joined: Dec 18, 2009
Posts: 10
Hi!

Someone can help me. I want transfer files by socket (any file). I thought in use a class of hierarchy of InputStream, but I encontered only the method avaliable() where this return an int with size of archieve. I believe that I have use an array of bytes to pass by socket but how I will get bytes ?


Tks....



Ivan Rodrigues
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42280
    
  64
Welcome to JavaRanch.

You'd use a FileInputStream to read the bytes of the file into a byte[].


Ping & DNS - my free Android networking tools app
Ivan Silva
Greenhorn

Joined: Dec 18, 2009
Posts: 10
Ulf Dittmer tks...., I succed do this operation!!!


 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Transfer file by socket