File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
How to print out # of bytes used
Joined: Jul 24, 2003
Jul 27, 2003 23:08:00
Is there a method I can use to determine how much space a vector is taking up? For a program I have to write I need to print out how many bites my vector uses after inserting keys into it.
Joined: May 26, 2003
Jul 28, 2003 19:07:00
If the objects in your Vector implement
ByteArrayOutputStream bytes = new ByteArrayOutputStream(); ObjectOutputStream oos = new ObjectOutputStream(bytes); oos.writeObject(vector); bytes.toBytes().length;
How To Ask Questions The Smart Way
Blogging on Certs:
SCEA Part 1
Part 2 & 3
Core Spring 3
TOGAF part 1
With a little knowledge, a
cast iron skillet
is non-stick and lasts a lifetime.
subject: How to print out # of bytes used
I/O with a DefaultTableModel object
retrieve beans value using EL expressions
empty vector cells
why does my code print out the same word 10 times
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2013