Thursday, 15 January 2015

stream - Java: common interface to InputStream and OutputStream -



stream - Java: common interface to InputStream and OutputStream -

this question related (in way) this one.

basically, want create function, this:

public inputoutputstream func() { if (condition) { // open file stream , convert inputoutputstream } else { // create inputoutputstream string } }

several questions arise:

i can't find anywhere class inputoutputstream. it's inputstream , outputstream , variations (like inputdatastream, outputdatastream, etc). there one? need stream supports both read , write operations. how can create inputoutputstream file? how can create inputoutputstream string?

for c++ inputoutputstream std::iostream. , can convert std::fstream or std::stringstream without problems. reachable in java?

thanks.

you consider using randomaccessfile instead.

java stream

No comments:

Post a Comment