Skip to content
Advertisement

Tag: bytearrayoutputstream

how to implement ByteArrayOutputStream?

I need help with implementing an byteArrayOutputStream that stores the output from the server, which I can then read from and print. Does anyone know how to do this? Any help would be much appreciated. TCPAsk: Edit: my code is now working and it is similar to the answer (TCPClient) given below with some minor additions. ByteArrayOutputStream is not needed.

Most efficient way to create InputStream from OutputStream

This page: http://blog.ostermiller.org/convert-java-outputstream-inputstream describes how to create an InputStream from OutputStream: Other alternatives are to use PipedStreams and new threads which is cumbersome. I do not like the idea of copying many megabytes to new in memory byte array. Is there a library that does this more efficiently? EDIT: By advice from Laurence Gonsalves, i tried PipedStreams and it turned

Advertisement