From: Lew on 5 Feb 2010 15:49 Roedy Green wrote: Krist wrote, quoted or indirectly quoted someone who said : >> Is the unclosed() byteArrayInputStream really cause the problem ? Based on my reading of the Javadocs (what is yours?), I'd say not. > It is a big array of characters that holds the entire stream. How > much of a problem it is unclosed depends on how big the stream it > holds is. It is just a StringBuilder in disguise. Is there any reason > you would NOT close the stream? Maybe this, from the Javadocs for 'ByteArrayInputStream' (what a funny place to look for information about 'ByteArrayInputStream'!): <http://java.sun.com/javase/6/docs/api/java/io/ByteArrayInputStream.html#close()> "Closing a ByteArrayInputStream has no effect." -- Lew
From: EJP on 7 Feb 2010 04:18 On 6/02/2010 5:33 PM, Kevin McMurtrie wrote: > InputStream.available() returns a value between 0 and the entire size of > the data. It returns the number of bytes that can be read without blocking, or zero in some implementations (e.g. SSLSocket). A practically useless feature. Use a standard size buffer like 4k, 8k etc.
|
Pages: 1 Prev: jdk 1.5 and windows 7 Next: object relational database versus "inteligent" serialization |