Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ByteArrayOutputStream size returns null.

Status
Not open for further replies.

AnthonyGeorge

Technical User
Jun 3, 2004
46
0
0
GB
I am writing to a ByteArrayOutputStream after every write I want to check how many bytes has been written.

So I call ByteArrayOutputStreams method size(), but instead of returning an int, it is returning a null pointer value.

Would be gald of any help in the correct way in calling the method size.

Thanks Tony
 
Do you mean it throws a NullPointerException. For return values, it can only return ints.

Tim
---------------------------
"Your morbid fear of losing,
destroys the lives you're using." - Ozzy
 
Maybe some code would help. If an exceptoin is thrown, post the stack trace.

Cheers,

Dian
 
It does throw a null pointer exception, I am using a wrapper written by someone else. I am writing straight into a database clob via a writer and not using the ByteArrayOutputStream, hence the null pointer exception.

Need to go back to the drawing board and think of another way of counting the bytes as they are written.

Thanks everone Tony
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top