Can I use both PrintWriter and BufferedOutputStream on the same outputstream?

前端 未结 3 939
傲寒
傲寒 2021-01-23 07:58

Can I use both PrintWriter and BufferedOutputStream on the same outputstream?

The situation is this:

I\'m having a SSLSocket program and I want to be able to tra

3条回答
  •  灰色年华
    2021-01-23 08:21

    I would use a DataOutputStream (possibly wrapping a BufferedOutputStream). It allows you to transfer byte[], int, double String and many other types. To send the byte[] you may want to send the length first as a int or short.

提交回复
热议问题