Hiho,
i have to copy an inputstream. And after a bit of searching in the net, i tried this with the help of a bytearray. My code looks like this("is" is the inputstream):
ByteArrayOutputStream bos = new ByteArrayOutputStream();
while (is.read() != -1) {
bos.write(is.read());
}
byte[] ba = bos.toByteArray();
InputStream test = new ByteArrayInputStream(ba);
InputStream test2 = new ByteArrayInputStream(ba);
And it works.. nearly
In both the stream, the programm copied only every second character So "DOR A="104"/>" in the "is"-stream becomes: "O =14/" in the other streams
What is the Problem? i can not understand what is going on.
Hope anybody could give me the solution:)
greetings