Should I ask for a BufferedReader or just a Reader?

Wrapping a BufferedReader in a BufferedReader is not a big deal, right?
Please consider these two methods:
public void exampleA(BufferedReader bufRdr) { ........ }
public void exampleB(Reader rdr) { BufferedReader bufRdr = new BufferedReader(rdr); ... }In exampleA, users with a Reader, but not a BufferedReader, cannot use the method (but I can't think
of any examples of when a user could not create the BufferedReader).
In exampleB, if someone passes a BufferedReader then that creates a BufferedReader wrapped in another BufferedReader.
While method overloading fixs this:
public void example(BufferedReader bufRdr) { ........ }
public void example(Reader rdr) { example(new BufferedReader(rdr));}If a BufferedReader wrapped in a BufferedReader is nothing of note cleary my best solution is exampleB.
Method overloading perfectly fixs the problem, but it clutters the API so thats why I'd prefer exampleB.

I would like to test my understanding of the before mentioned comments. Please consider:
public void foo(Reader rdr) {
  BufferedReader bufRdr = new BufferedReader(rdr);
  ... // do whatever
}After foo exits, there is still a reference to rdr.
The bufRdr object dies when foo exits.
bufRdr wraps rdr and provides a buffer where it temporarly holds data to allow for block reads.
There is no way to guarantee the buffer will flush before bufRdr is gc.
So, the above foo method is not safe.
Methods should never wrap a Reader/Writer/InputStream/OutputStream ( that has a reference outside of its scope ) with a local object that has a buffer.
For performance upside, I buffered anything I could get a reference to.
Now, I think this attitude is completely wrong.

Similar Messages

  • Authenticated binding: Should be asking for password when joining OD?

    Hello,
    I have enabled "Authenticated Binding" under OD-Policies-Binding.
    When I join a computer from Accounts to OD, should the OD be asked for password? It just presents the dialog for autoconfigure services and it just binds, without any credentials.
    Is it how it suppose to work?
    Regards
    Kostas

    So after unlocking the lock, entering your password, and clicking on Login Options, the checkbox for autologin is greyed out? Did you try clicking the toggle box anyway? Does that bring up a blank dropdown menu? Did you click on the little triangle?

  • Should I ask for a replacement or stick it out with a third repair

    The first repair must have been August 8th or 9th. It had the moo issue, the lid creaked, and when I shut my computer down and closed the lid (after the screen went black) the indicator light would remain on and when I came back to the computer it would be searing hot.
    All they did was replace the fan with a Sunon fan. The night I received it, nothing changed. So I sent it in again. This was August 18th when they received it. They replaced the heat sink . I got it back on Thursday (just passed) and the lid was better for a day, it now creaks. It mooed, so I just did the SMC update (which fixed the mooing completely). The shutdown issue happen again too. And NOW, the whole right side of the trackpad's button is not only mushy, but nonresponsive. The right side just doesn't work. Should I send it in for yet another repair? Should I ask for a replacement? Should I be grateful it doesn't have the wretched Random ShutDowns? What's the concensus? I'm on holding with AppleCare now waiting for the next available representative (as I have been for the past 14 minutes).

    An update in case anyone is the least bit interested;
    I asked for the replacement. The lady (Ashley) transfered me to a technician or specialist or some other euphemism for second tiered employee named Tim. Tim suggested I go into an Apple Store and have them do the repair there. That night, I experienced the "waking from off syndrome" again and figured I'd have to mention this to them as well. Did that at the store and they decided they were going to send it off to Memphis yet AGAIN. Definitely not what I was told by Tim. He said they would fix it in store. He said they'd probably hold on to it for a few because they didn't have any replacement top cases to fix the trackpad button, but he said nothing of them sending it back into Flextronics (who, I'm convinced, are quite incompetent; they're the ones who broke the trackpad button). I know they're going to muck this up again. This time, I think they're going to replace the logic board. Illogical! I don't suppose it will help, but I could be wrong. Iffin' I experience another wake from off incident after I get the thing returned, what's the liklihood of Apple replacing my machine with a new MacBook (versus not replacing it or replacing it with a refurbished machine)?
    I'm fed up. Macs don't necessarily just work. They potentially frustrate.
    Sorry for the quasi rant

  • Hi i bought a macbook pro 8 and half mounths ago. Today i had the hard drive replaced as it was faulty and on Monday i have to take it back to the Apple shop to have the Motherboard replaced. I feel that i should be asking for a new macbook, where do i st

    Hi i bought a Macbook Pro 8 & a half mounths ago.Today i had the hard drive replaced as it was faulty and on Monday i have to take it back to the Apple shop to have the Motherboard replaced. I feel that i should be asking for a new macbook, where do i stand.

    Yes thats what i thought but i only have 77 days left on my garentee so its a worry, and have to drive 1 hour to get to closest Apple shop, spent the whole day there today when i should have been at work and have to make the drive again on Monday Then back again next Friday to pick it up. I paid over £1000 ponds for this computer so wouldnt expect it to have its insides replaced befor a year. Feel very let down, and no longer love my macbook pro.

  • When I bought my Mac they gave me a free hp printer. My mac is a 10.7 and the printer is for 10.6 and below.... so why did they give me this printer? Can I use it somehow or should I ask for a different one that is compatible with my computer?

    When I bought my Mac they gave me a free hp printer. My mac is a 10.7 and the printer is for 10.6 and below.... so why did they give me this printer? Can I use it somehow or should I ask for a different one that is compatible with my computer?

    Can I use it somehow or should I ask for a different one that is compatible with my computer?
    No, that's not necessary.
    You Mac most likely sat in inventory before it was sold so the latest drivers were not installed.
    If you tried using the printer and couldn'tget it to work, go here >  http://www8.hp.com/us/en/support-drivers.html
    If this is a USB connected printer, make sure it's connected to your Mac, then at that link click:  Detect Your Product
    Download and install drivers for v10.7 / Lion.

  • Just bought a refurb PB G4 via power seller on ebay. Froze on 1st power up. Report says unresolved kernel. Is this terminal or fixable. Should I ask for money back whilst under warranty? I am not techie so worried and not sure what to do?  OSX 10.5.8

    Hi
    Just over a week ago I bought a refurb Powerbook G4 via a power reseller on ebay. The first time I switched it on it froze said OSx had quit unexpectedly... assumed I had done something wrong as not very techie so forced shut down and started again. It is saying the same message frequently and freezing... report says unresolved kernel etc etc etc.
    I emailed the apple specialist I bought it off and he advises restarting by inserting the OSX disc and pressing down the C button to reboot from there then selecting disk utility, hard disk and repair. He says it shouldn't be happening as it was fully tested before dispatch?? The only thing I have loaded is an update to adobe and Software for my 3 dongle but as it was freezing before I loaded either of these I don't think they can be responsible??
    Please can somebody advise if this is a serious problem. I believe I have warranty for 14 days on this item and I am worried I may have bought myself into a problem. Is this a simple thing to repair. Does he mean me to hold down the C key on the alpha keyboard or the ctrl key? (I emailed him and asked him that 2 days ago and he hasn't responded, hence my worries)... I am sorry if that is a stupid question but I really am not very techie at all.....
    Should I just ask for my money back??? If it is a simple repair do I just literally push the disc in, push the power button and hold down the C button?
    Any advice would be really apprciated.....
    Thank you
    Debbie

    Debbie:
    deborahfromwindsor wrote:
    he advises restarting by inserting the OSX disc and pressing down the C button to reboot from there then selecting disk utility, hard disk and repair.... Does he mean me to hold down the C key on the alpha keyboard or the ctrl key?
    Should I just ask for my money back??? If it is a simple repair do I just literally push the disc in, push the power button and hold down the C button?
    That's where I would begin, too, with
    Repair Disk
    Insert Installer disk and Restart, holding down the "C" key until grey Apple appears.
    Go to Installer menu (Panther and earlier) or Utilities menu (Tiger) and launch Disk Utility.
    Select your HDD (manufacturer ID) in the left panel.
    Select First Aid in the Main panel.
    (Check S.M.A.R.TStatus of HDD at the bottom of right panel, and report if it saysanything but Verified)
    Click Repair Disk on the bottom right.
    If DU reports disk does not need repairs quit DU and restart.
    If DU reports errors Repair again and again until DU reports disk is repaired.
    If DU reports errors it cannot repair you will need touse autility like TechTool Pro,Drive Geniusor DiskWarrior
    First we need to determine if the issue you are experiencing with the computer is software or hardware based. Once we have gotten things sorted out there should be time enough to make you decision about keeping or returning it.
    cornelius

  • Ordering Infinity - what should I ask for

    Hi everyone,
    All in all I'm a fan of my BT service when it works (most of the time) - I hate the Indian call centre, love the advice/service from the contributors and mods here etc (probably a familiar scenario).
    Anyway, I've just checked the BT Infinity availability and my phone/postcode shows that I can order as of today - last week it showed earliest date as end of March - todays change is the same for the TalkTalk fibre service so I think it's genuine (or at least from Openreach, not just from BT). Is this likely to be a real date or just trying to fish for customers? There have been a lot of Openreach engineers around lately, but I haven't seen them at my cabinet.
    I want to get infinity to upgrade my current ADSL2+ service and thought I'd ask for advice to ensure I ask the right questions when I order my upgrade. Any comments welcome :-)
    My current service is Phone + Broadband + BTVision. 5 months contract remaining on all services.
    Phone: Rarely used except to receive PPI claims calls etc - ie, VERY low use.
    Broadband - Heavy users: Me + Nagulese + 3 boys - Xbox, internet, youtube, streaming movies etc. Down ADSL has 11.5MBps sync with 10.5MBps useable connection. Up ADSL is approx 800 kBps.
    BT Vision: Use catchup TV and ocasional movie rental, but movie rentals recently increased to 1 or 2 a week.
    What I want is:
    Contract: Not too worried if 12 or 18 months as long as it works.
    Phone: Need the line only because it's necessary for BB/TV service - we use mobiles normally for calls.
    Broadband: I want best infinity available - quoted as 59Mbdown / 19Mb up. I'm somewhere between 400m and 500m from my cabinet (depending on the route for the copper). I want unlimited service, but not to worried about P2P (which I think is included now anyway)
    BT Vision: I have the BTV black box. I want to get youview and move the BTV box to another room. At the moment I'm not interested in the sports packages which need viewing cards, and I'm happy to wait for these to be available on linear channels. Will I be able to use both of these boxes on the same service, both as freeview boxes and also for BT Vision/youview? I'm currently using the BTV box on powerline adaptors (200Mbps work fine), but I'll probably re-wire with ethernet around the house in the near future.
    In all I'm happy to wait for the right services. If I order and I'm told I need to wait 3 months for connection then fine, but I hate being told 'only 2 weeks' then having to wait 3 months - is there any way of getting REAL (not sales speak) dates etc?
    As I said, any comments either good or bad are welcome, but please don't use the thread just to vent or whinge about bad services - constructive comments only.....
    .....Cheers,
    Alan.

    place the order if your cabinet is active you will get a confirmed Install date
    as to reliability the service is very stable I have personally had it since March last year not one disconnection I was quoted 66/20 when installed received 76/20 speed never varies more than +/- 1.5mb at any time hub has restarted once and that was for the firmware update to the HH3a
    As to vision and Youview on the same line I am not sure but i do not think it is possible.
    Maybe some one else could advise you there
    this link should tell you if your cabinet is live and accepting orders http://www.dslchecker.bt.com/adsl/ADSLChecker.TelephoneNumberOutput
    If you want to say thanks for a helpful answer,please click on the Ratings star on the left-hand side If the reply answers your question then please mark as ’Mark as Accepted Solution’

  • My wrt160n is starting to have a lot of problems.. should i ask for a replacement??

    i had no problems before with this router. but lately i'm noticing a lot. first, it started to reset itself. all my setting went back to default and was configured for open access (unsecured wireless connection). this happened a few times last week. i had to configure my settings again and again and again.
    second, my wrt160n wifi LEDs keeps on blinking. even when no wifi devices are accessing it. i checked the client table on the setup page and i see no devices listed. how come the wifi LEDs are still blinking??
    third, i noticed that my bittorrent dl speed went down. i can't reach top dl speed unlike before. and my network connection on bittorrent is always red or orange. it takes a long time before it turns green(Network OK). i'm actually downloading an episode of heroes right now with hundreds of seeders and peers and i'm only getting 15kB/s!! i had way less seeders before and i still get top dl speed. now with even more seeders I GET LOWER DL SPEED!! EVEN WHEN THE NETWORK CONNECTION ALREADY TURNED GREEN.. WHAT THE HELL??!!
    can someone please tell me if my wrt160n router is already defective?? i already tried upgrading the firmware, but nothing happened. is there any kind of setting i should be doing, or does it sound like my router is already defective and i should ask for a replacement??
    help please anyone..
    any help, info, and suggestions would be very much appreciated.
    thanks.

    richard804 wrote:
    It is not your router.  It is your ISP lowering the speed of your torrents.
    i don't think its my isp. i'm getting good results now from my router. i don't know how i did it but my router seems to be working fine now. i'm getting top dl speeds and it stopped from resetting itself.
    one last problem though. is it normal for the wireless lan LED to be blinking all the time even though there's no wifi device accessing it??
    it was'nt like that before. it never blinks when all our laptops are turned off. but lately it never stops blinking even with all the laptops turned off. i always check my client table at the settings page and i'm the only one accessing the router thru a wired connection (no wifi devices).
    does it sound like my router has a problem?? or is it normal for the wireless LED to be blinking non-stop??
    what do you guys think??
    tia.

  • Should i ask for a replacement

    I only get about 9 hours total out of the 12
    60%brightness,using safari listening to pandora, scrolling through facebook, and plenty of time idling (the screen is left on a page, for example pandora.com while i do homework, screen is still on but uses significantly less power since i'm not doing anything).
    It seems using facebook really drains my battery idk why
    Also, my download speeds are kind of wonky. I downloaded chrome once, took me 5 seconds. Couple hours later, i deleted chrome and reinstalled chrome, took me 15 minutes.

    as stedman1 said 14 battery cycles are a lot for 1 week, and won't be a good idea to use your computer in this way.
    Finding out how old your computer is and what you seam to be using it for i would say 9 hours is good, you are streaming a lot of data and for Facebook to get a file like video and photos is a lot of data well can be so would again have to download this and play it or show it meaning using a lot more power.
    So to go back to your question no i don't think you should ask for a replacement.
    Hope this helps, in the life of your computer and your self.

  • My ipad wont connect to wifi, it asks for the password then just loads?

    i hit the thing to connect to my wifi and it will ask for my password and once i hit join it just loads. it works when im at school but once i go to connect to my house wifi it wont?

    Settings>General>Reset>Reset Network Settings. Then reboot your iPad.
    Reboot the iPad by holding down on the sleep and home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider if it appears on the screen - let go of the buttons. Let the iPad start up

  • Where should one ask for help with a thread   ???

    Having posted a link to this thread because the op needed someone to check a site in Panther.... and because not so long ago I read here that this was the place to ask for such help.....
    I now find the my request has been removed... musta offended the tou of course.
    Sooo - how should a person try to get help with a thread in future? - we ain't all l4's and have a lounge to play in.

    Interesting question. This forum was available for this type of request at certain points in Discussions' history, and it has often been recommended that users post issues like yours here.
    Technically, as per the red print at the top of this forum, it is inappropriate to use this forum for that purpose. In the case you cite, I'd recommend putting a new topic in to the Safari forum with a specific request for the help that is required in the Subject line. If you do it that way, you will most likely reach more users who will be able to help you.
    Good luck.

  • When should I ask for CLI?

    I have two Cap ones, I guess they were both the step program. Ive had the first one 2.5 yrs. Its limit is 2k and its been close to maxed out for awhile. I usually pay a few hundred a month and use again, not paying attention to statement cut dates. I finally got into position and PIF last month and intend to PIF from now on. My second Capital one is quicksilver MC. Ive only had it 6 months and go my first increase from 1000-3000 without asking.  Just curious about the first card. Should I wait a bit to let them see im PIF now? What about second card? Ill be using that one more because its my only reward one.  I tried walmart, they said no. Ive had it 2.5 yrs, its been late but not 30 days. Limits 500. Thanks Tara

    baseballmom44 wrote:
    I have two Cap ones, I guess they were both the step program. Ive had the first one 2.5 yrs. Its limit is 2k and its been close to maxed out for awhile. I usually pay a few hundred a month and use again, not paying attention to statement cut dates. I finally got into position and PIF last month and intend to PIF from now on. My second Capital one is quicksilver MC. Ive only had it 6 months and go my first increase from 1000-3000 without asking.  Just curious about the first card. Should I wait a bit to let them see im PIF now? What about second card? Ill be using that one more because its my only reward one.  I tried walmart, they said no. Ive had it 2.5 yrs, its been late but not 30 days. Limits 500. Thanks TaraI have tried their luv buttom almost everyday to no avail and now i know with my accounts it only works every six months. Even tried the EO and did not go through. So you might be different and get it now via luv or calling. Every person here has had different experiences so really just try now and find out lol 

  • My 2013 15" retina macbook pro screen has a yellow tint, should i ask for a replacement?

    So yesterday i got my retina macbook pro 15 " and right away i noticed my worst fear ( since i previously had read some similar stories) my screen has a noticeable yellow tint specially on white tones, websites have a "newspaper look " to them, since i bought this computer because im starting web design in university in a couple of months i would say i'm pretty much ******, people say i shoud just calibrate it, but most people dont calibrate their screen, so it would be  a mess, my work would look good on my computer but ****** on other's people computer
    I'm very surprised because i thought this issue only affected the initial batch of retina macbook pros, but i checked my serial online and my computer was made in January 2013 so its quite new, the panel is a Samsung "LSN154YL01001.
    I have read that usually LG panels don't suffer as much from the yellow tint but they suffered from Image retention, is it stil like this? what do you think i should do should i keep this computer with the samsung screen or get apple to give me a new one hopefully with a LG panel or at least a samsung without yellow tint

    Actually MOST People that work in all parts of the Design field DO Calibrate their screens. It is the only way to make sure what you are looking at on your computer screen will be the same on other design professionals screens and to the general public.
    Wherever you got the notion that Design professionals and or design schools of all types don't calibrate their screens is completely incorrect.
    So it is up to you whether you calibrate or not and or to return that Retina for one that has a better color balanced screen from the start. Along with that the new unit you get may have other problems as the Retina models are plagued with random problems. The screens only be one of them.

  • Why I am being charged for Total Mobile Protection when I never asked for it?  I just checked my bill on My Verizon and was surprised at this additional charge.

    I just checked my bill online after upgrading my phone to a iPhone 6 and now I am being charged for something called Total Mobile Protection.  Is this some kind of phone insurance or something?
    I was never charged this before so was kind of upset to see it added on without my permission/knowledge (I specified to the Verizon Wireless agent in the store I went to that I only wanted the contract for the $60  2GB and Unlimited talk/text plan that I currently had.  They said that would work).
    How can I get this extra $10 a month off my bill?

    When you upgrade online you do have the option to deny this though the deny option is way down the page. make s it look like you have to choose an insurance option. Also I've done 2 recent upgrades in a retail store twice and both times they added the protection without asking. Luckily I always check my account so I easily removed this feature on the first day. Let's just say I won't be upgrading at this store ever again. No wonder people get mad when they upgrade multiple lines and their bill is $30, $40, $50 higher than what they a were told because of this unasked for feature.

  • What week iPhone should I ask for???

    I plan on trying to return my 3GS tomorrow becuase of the battery and a couple other things. What week seems to be the problem free? Do we know yet? Thanks!

    I'm not sure this even matters. Most of the sales reps there have no idea about week builds and currently the 3GS's are selling quite quickly so there aren't an abundance of stock for them to choose from. They are basically selling each batch they get.
    Here in cupertino we moved a week's worth of each day for 4 days. Release ones were 21, then the next day was 22, then 23 and 24. Sales started slowing down at week 25 and most likely if you go now you will get week 26. Someone posted earlier about getting a week 27 so I'm guessing those are going into the wild now.
    Nothing is for sure but here is my experience after comparing about 25 phones between friends/family and 10 more from apple stores.
    21: high chance of poor battery
    22: small chance of over heat issue
    23: best screens (most apple stores all have 23's... i'm sure that's no coincidence)
    24: no experience
    25: small chance of good screens
    26: high chance of yellow screen (personally saw 9 that were all yellow... comparing to the week 23's of the stores. Yellow gradient rate was high as well meaning top and bottom were different shades.
    No experience with 27 yet. My girlfriend's week 26 white has 2 cracks on the top near the headset jack... we are waiting for 27's to exchange.
    My advice to you is to go get one anyways. If there's an issue, just return it. Even from all those experiences, those could just be flukes or bad draws... or you may just get a good draw on which ever batch. Good luck though

Maybe you are looking for

  • Touchpad no longer scrolls screen. Using bars area on rhs of touchpad used to scroll screen.

    After following PC Mag article on speeding up a very slow PC. I find I am now unable to scroll using my touchpad. Although this is not a major problem, it is bothersome when using the laptop where a mouse can't be used. All the other functions of the

  • Added SPDIF Optical out to MSI A75-G35 and I get no sound

    Hello, I connected a TOSLINK cable to my Onkyo receiver in lieu of 2 channel analogue.  I know I'm configured correctly on the receiver's end.  I set up my realtek HD audio manager to send music via WMP to the receiver using the PC's optical output. 

  • Save as 3ds

    Hi I would like to know if anyone has got experience with exporting the simpleUniverse or anything from the universe into a 3ds file. If you have any idea, tried it or know any extentions that can do it I would really like to know. I have the idea th

  • Stacked bar chart should not sort by values but by month

    Hello, I have a problem concerning a stacked bar chart (Apex 4.0 / Anychart). X-Axis contains Months and Y-Axis contains values. Values are splittet to 4 Values (a,b,c,d) But if there is no value for a in February the sequence will jump to march disp

  • How to fetch bank fields in fbl1n

    plz tell me the process how to fetch bank details of particular vendor in fbl1n. Moderator message: welcome to SCN, always search for available information before posting, show what you have done yourself when posting. Edited by: Thomas Zloch on Jan