![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Apr 2005
Posts: 1
Rep Power: 0
![]() |
Sending files over a network
Has any one any experience of sending files over a network using java? I have the JFilechooser working where I select the file I want then when I try to put it in a ObjectOutputStream I get an error that tells me that the stream header is wrong can anyone help?
|
|
|
|
|
|
#2 |
|
Programmer
Join Date: Mar 2005
Location: different places. constantly on the run.
Posts: 57
Rep Power: 4
![]() |
i was working on something like that, but then it got complicating and i'm also studying and right now now i'm so damn hungry, i'd even eat the last pie at the petrol station's shop.
you'll have to read from your file and then transfer it to the other computer where it will have a file open somewhere and read from your stream and write whatever comes its way into the file. i'm reading a byte, sending it to the other pc and then on that side, reading it from the stream and writing it to a file. doing that until the sender has reached the end of the file. don't know if it works yet.Ü
__________________
There's got to be more to life than being really, really ridiculously good looking |
|
|
|
|
|
#3 |
|
Programming Guru
![]() ![]() ![]() |
I was going to mention that, piece-mealing the data over in packets and reconstructing it on the other side.... but, what would happen with concurrent processing. If there are no "checks and balances" in place, the data would get hammered and the files would be invalid at best.
__________________
http://jasonpowers.net "There are a thousand hacking at the branches of evil to one who is striking at the root." |
|
|
|
|
|
#4 |
|
Programmer
Join Date: Mar 2005
Location: different places. constantly on the run.
Posts: 57
Rep Power: 4
![]() |
ok, i finished mine and tested it on localhost. the problem i get, is that it runs my processor at 100%. i thought it might need a thread when it's sending and receiving, but that didn't seem to help. i can understand why it's doing that, but not how to free up my processor... if that makes sense.
__________________
There's got to be more to life than being really, really ridiculously good looking |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|