• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Transfer file by socket

 
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
Pie
Posts: 42967
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!!!


 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic