Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Transfer file by socket  RSS feed

 
Ivan Silva
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch.

You'd use a FileInputStream to read the bytes of the file into a byte[].
 
Ivan Silva
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf Dittmer tks...., I succed do this operation!!!


 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!