Take the 2-minute tour ×

I am working in java my goal is that I have to read from a file and at the same time I have to append that file by another code it will be like an executable abc will be reading file 'myfile.txt' and another executable xyz will appending 'myfile.txt'. Is it possible , what concept I should apply to get it work . *I read somewhere that it depends on OS then while working on android AVD will it be possible ? *

share|improve this question
this because I am receiving a very large file from server , and while receiving it I am also using it received contents. –  user1074474 Dec 11 '11 at 6:02
will that be possible in same executable ? that is in multi threading reading and writing the file –  user1074474 Dec 11 '11 at 6:18
I don't understand why people are voting to close this question. It is clear what the OP is asking, and it is certainly implementable. –  Stephen C Dec 11 '11 at 7:06

1 Answer 1

up vote 2 down vote accepted

It is theoretically possible to do that, though not particularly efficiently. For example, you can implement this kind of thing using the Apache Commons Tailer class.

However, I can't help thinking that you would be better off using a "pipe" that one application writes to and the next one reads from. Since Android has Linux underneath, there should be a way to create and use pipes.

And if you want to do this within a single Android application, you can use Java intra-process pipes; e.g. PipedInputStream and PipedOutputStream.

share|improve this answer
thank you very much Stephen for your answer and support , the people trying to close this question because they are unaware of the application I am developing and I don't wish to disclose my idea .Your answer and 95K points tell alot –  user1074474 Dec 11 '11 at 11:10

Your Answer


