I don't see why the class itself is burdened with reading a system parameter and parsing an interger stack size out of it. Put that code somewhere else, and pass the int value in as a constructor parameter. This will let you test the class behaviour for different values of the stack size, which is needlessly hard at the moment.
I'm a bit worried by the isClosed stuff. All that seems to happen if the stack is "closed" is that some operations throw a generic IOException. I can't see that this is especially useful behaviour from the perspecive of the client code. If the client code gets one of those exceptions, what should it do then? I assume it is there because client code is "not supposed" to call "put" or "flush" when it's not appropriate. Why not move this open/close/prevent behaviour and its flag outside to a "gatekeeper" or "decorator" class which you can choose to use or not.
Thomas Smets
Just another developper
Out primary goal is to gain speed !
I therefore need something close to C / C++ to have rocketing number first !
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Did you see how Paul cut 87% off of his electric heat bill with 82 watts of micro heaters? |