4
4
4ainik2017-03-16 20:53:21
Android
4ainik, 2017-03-16 20:53:21

How to conjugate the non-conjugated?

The beginning of the problem is here
It would seem that I independently found a solution:

InputStream in = new java.net.URL(url).openStream();
FileWriter fWriter = new FileWriter(sdCardFile, false);
byte[] buf = new byte[128];
while(true){
  int n = in.read(buf);
  if(n == -1){
    break;
  }
}
fWriter.write(buf);					
fWriter.close();

But there is one "BUT": InputStream works with byte, while FileWriter works with char, just some kind of cretinism, honestly :)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
one pavel, 2017-03-17
@4ainik

apart from fileWriter, java provides a rich selection of tools
https://docs.oracle.com/javase/7/docs/api/java/io/...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question