N
N
nikesport2014-11-20 11:03:16
Java
nikesport, 2014-11-20 11:03:16

How to clear an InputStream ?

Help people. The fact is that in my loop, every 3 minutes, InputStream.read() checks the incoming data and writes them to the database, how do I clear the stream after each reading so as not to write the same thing to the database?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
Nikolai, 2014-11-20
@j_wayne

reset
https://docs.oracle.com/javase/7/docs/api/java/io/...

Y
YV, 2014-11-20
@targetjump

Clear stream?
What would that mean?
Can I ask you in more detail what kind of stream are you using?
For it is impossible to simply take and "clean" any InputStream.
And yes, are you sure that you need to "clean" the stream?
Perhaps you just need to change your approach to reading from the stream?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question