This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
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 EJB 3 in Action this week in the EJB and other Java EE Technologies 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: 39543
    
  27
Welcome to JavaRanch.

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


Ping & DNS - updated with new look and Ping home screen widget
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
 
Similar Threads
Urgently Need Help.....
FTP
video in java
name of file
reuse socket