Streams - what is it

So I have been using Streams. But, recently when I started thinking about it I really got confused as to what really streams are. I looked it up online but couldn't find my question answered. I really got confused, when we got the requirement of creating a file from HttpServletRequest.getInputStream() for certain conditions. Problem was that we already hit EOF on that stream by the time we are done reading that "condition" that tells us to write InputStream to a file. So we decided to use mark()/reset() and that's what is currently being used. That led me to thinking that probably Java is caching the data and it really is not true re-reading, but reading from cache when reset is called; If that's true then this defeats the purpose because this will just increase the size of JVM significantly.
Thinking about the above problem I got basic questions that I couldn't find it online:
1. What exactly are streams? Is Stream something on network or is it something that's part of the JVM that's trying to read the InputStream? I want to be sure of what the affect on JVM size is.
2. When I call mark/reset does it get cached inside the JVM or does it read from the stream again. Here when I say read from stream again, I am really thinking that stream is somwhere outside of JVM.

That led me to thinking that probably Java is caching the dataNo. The stream is caching the data. In this case the stream returned by HttpServletRequest.getInputStream(). The documentation for mark()/reset() makes it clear that not all streams can do that.
If that's true then this defeats the purpose because this will just increase the size of JVM significantly.Only if the specific stream supports mark() and reset(), and only within the marklimit you specified when you called mark().
1. What exactly are streams?An API for doing input and output.
Is Stream something on network or is it something that's part of the JVM that's trying to read the InputStream?It's an object in the JVM.
I want to be sure of what the affect on JVM size is.The effect is a cost of up to 'marklimit' bytes.
2. When I call mark/reset does it get cached inside the JVM or does it read from the stream again.It is cached inside the object.

Similar Messages

  • I have a an iMac 11,2 is there anyway I can stream what's on my computer screen to my HD TV? I have apple TV2 also.

    I have a an iMac 11,2 is there anyway I can stream what's on my computer screen to my HD TV? I have apple TV2 also.

    You're talking about Air Play Mirroring About AirPlay Mirroring in OS X
    Your 2010 iMac doesn't meet the requirements For AirPlay mirroring but you can take a look at AirParrot http://www.airsquirrels.com/airparrot/

  • Can I stream what is on my computer to my TV using ATV?

    I am new to ATV, can I stream what I am doing on my computer it my TV using ATV. Thus almost using it like a monitor?
    Thanks

    No. You can stream content from iTunes (if it's in a approved format), rent movies (TV shows if you're in the US), view netflix, youtube and podcasts. You can also stream music (ipod app and select 3rd party apps) and videos (youtube and ipod app) from your iphone/itouch.
    You would have to connect a computer directly to your TV to do what you're asking.

  • New pictures on iphone4s don't stream. what is the problem?

    new pictures on iphone4s don't stream. what is the problem?

    - How to Recover Restrictions Forgotten iPhone Restrictions Passcode | The iPhone and iPad Blog
    Apps crashing
    See:
    iOS: Troubleshooting applications purchased from the App Store
    Contact the developer/go to their support site
    Restore from backup. See:
    iOS: How to back up              
    Restore to factory settings/new iPod

  • HT4906 I have upgraded my OS to Mountain Lion and updated Iphoto to latest, however, I still can not access photos sent to me via photo stream. what else do I need to do? I'm $30 into this effort, and no results!

    I have upgraded my OS to Mountain Lion and updated Iphoto to latest, however, I still can not access photos sent to me via photo stream. what else do I need to do? I'm $30 into this effort, and no results!

    Log out of iCloud in the System/iCloud preference pane and disable Photo Stream in iPhoto's Photo Share preference pane.  Then log back in and re-enable, respectively.  That should jump start Photo Stream.
    OT

  • HT201335 how can i stream what im doing on my laptop on the apple tv

    how can i stream what im doing on my laptop on the apple tv

    Welcome to the Apple Community.
    AirPlay Mirroring requires a second-generation Apple TV or later, OS X 10.8 or better and is supported on the following Mac models: iMac (Mid 2011 or newer), Mac mini (Mid 2011 or newer), MacBook Air (Mid 2011 or newer), and MacBook Pro (Early 2011 or newer). You can see which Mac you have and which operating system you are using by selecting 'About this Mac' from the Apple menu in the top left corner of your Mac and selecting the 'More Info' button.

  • Safari crashed and the mac keeps getting the pinwheel of death, especially when streaming. whats going on???

    I was streaming a baseball game and safari crashed on me, i have a macbook air osx7.1. it said it sent a message to apple about the situation. been having problems with then pinwheel of death! especially when I'm streaming the pinwheel will pop up for no reason. does anyone have any idea what the problem could be??

    Launch the Console application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Console in the icon grid.
    Step 1
    For this step, the title of the Console window should be All Messages. If it isn't, select
              SYSTEM LOG QUERIES ▹ All Messages
    from the log list on the left. If you don't see that list, select
              View ▹ Show Log List
    from the menu bar at the top of the screen.
    In the top right corner of the Console window, there's a search box labeled Filter. Initially the words "String Matching" are shown in that box. Enter the name of the crashed application or process. For example, if iTunes crashed, you would enter "iTunes" (without the quotes.)
    Each message in the log begins with the date and time when it was entered. Select the messages from the time of the last crash, if any. Copy them to the Clipboard by pressing the key combination command-C. Paste into a reply to this message by pressing command-V.
    ☞ The log contains a vast amount of information, almost all of which is irrelevant to solving any particular problem. When posting a log extract, be selective. A few dozen lines are almost always more than enough.
    Please don't indiscriminately dump thousands of lines from the log into this discussion.
    Please don't post screenshots of log messages—post the text.
    ☞ Some private information, such as your name, may appear in the log. Anonymize before posting.
    Step 2
    In the Console window, select
              DIAGNOSTIC AND USAGE INFORMATION ▹ User Diagnostic Reports
    (not Diagnostic and Usage Messages) from the log list on the left. There is a disclosure triangle to the left of the list item. If the triangle is pointing to the right, click it so that it points down. You'll see a list of crash reports. The name of each report starts with the name of the process, and ends with ".crash". Select the most recent report related to the process in question. The contents of the report will appear on the right. Use copy and paste to post the entire contents—the text, not a screenshot.
    I know the report is long, maybe several hundred lines. Please post all of it anyway.
    If you don't see any reports listed, but you know there was a crash, you may have chosen Diagnostic and Usage Messages from the log list. Choose DIAGNOSTIC AND USAGE INFORMATION instead.
    In the interest of privacy, I suggest that, before posting, you edit out the “Anonymous UUID,” a long string of letters, numbers, and dashes in the header of the report, if it’s present (it may not be.)
    Please don’t post other kinds of diagnostic report—they're very long and rarely helpful.

  • How Come, after updating to ios 6 iPhoto no longer supports photo streaming What happened?

    How Come, after updating to ios 6 iPhoto no longer supports photo streaming? What happened?

    You probably just need to re-enable Photo Stream. It's not clear what the difference is, but there is an option to enable Photo Stream (as well as Shared Photo Stream) in both the iCloud Settings and the Photos & Camera Settings.
    -Doug

  • HT204022 server error when trying to delete my photo stream, what do i do?

    my windows 7 keeps givine me problems when i try to delete photos from my icloud. He wont give me the option to go in there even i go to the folder manually it shows theres nothing in there. But my phone says its full. I cant find my photos and it wont let me delete them either cause it gives me an error message saying there was a server error. How do i go about getting this fixed? Also my computer isnt allowing me to update my itunes to the new 10.6.3. That also keeps giving me an error message.

    http://support.apple.com/kb/TS3694#error3194

  • HT201317 what if my windows computer is not showing me the option to set up my icloud and photo stream, what do i do??

    how do i fix this??

    Only the previous owner can help you.  They either need to provide you with the ID and password to delete the existing account, or erase the device and remove it from their account as explained here: http://support.apple.com/kb/TS4515.  If they aren't willing to do that, return it and ask for your money back.

  • HT4906 what iPhoto update do i need to turn on photo stream

    How can i turn on photo steam from icloud    it says i need an i photo update in order to turn on photo stream   what update??  I want to turn photo stream on from my mac

    OS X 10.7.4 and iPhoto '11 9.2.2. Or later
    http://support.apple.com/kb/HT4486 for full info
    LN

  • Last wednsday All of my contacts disappeared. This wednsday my photo stream. What can I do?

    My things are disappearing for no reason. All contacts lost. Now my photo stream. what can I do?

    Download the free ClamXav and run a scan.
    What likely happened is you got a Windows virus on a email and send it out, it didn't affect your Mac, but it did pass the malware on.
    There is some Mac malware out there, and it's possible your machine may have been infected, so read this
    Harden your Mac against malware attacks

  • What do you use to listen to streams / podcasts / last.fm ?

    I'm looking for a way to manage my stream, podcast and last.fm music listening, preferably through a single  ncurses or a GTK based interface. I'm still using BMPx which is a buggy, no longer maintained resource hog but has some features that I really like such as:
    - uncluttered intuitive interface
    - Last.fm tag cloud, similar artists, album art, quickly look up artist info on the web
    - easy way for searching and filtering shoutcast and icecast streams
    What do you use?

    Great guestion mate!
    I use smartphone LG Spirit 4G for Netflix and Spotify on the go with Sennheiser CX2.00G earphones. Great sound, really stunning bass and vocals on these. Pleased everytime to hear every detail outside home no matter music or series/movies. 4.7" screen.
    At home I will try to use for music Pioneer SMA1 again, as finally I can remote it with new phone without problems. Cheap phone was freezing on app all the time. For series/movies I have Philips 42PFL5008T 42" Smart-TV. I remote Netflix and YouTube app now using my phone - as it never freezes now. Old was unable to remote well, as it was cheap.
    On laptop I do everything else. Since laptop is Ubuntu, Netflix will not work and Spotify app is no-needed and hard to install, web player low quality. Laptop is for forums, surfing, blogging etc.

  • Can anyone help me with compressions for web streaming? So lost!

    Hi there
    I am so confused !
    I have the task of getting HD footage from my camcorder ready for quality web-streaming on a website. The clips need to be in mp4 format using the H264 codec. As we are dealing with HD footage, I want the viewer to be very happy with the picture quality. I must admit that most of my compression settings were kind of guess work and I was only judging my results by the final file size in relation to the video quality. I was getting file sizes of about 16mb per minute of video/ audio footage.
    I had been keeping my frame size at 1280x720 and my bit rates were about 2000-2500kbits/s. Bandwidth is a real concern as there will be alot of people streaming these videos and there might be over a hundred videos on offer at any one time. I found that bit rates any less than this were resulting in a poor picture quality.
    I have since learnt that what I was doing is completely wrong!
    I was told that my frame size was way too big for normal web-streaming of HD footage and also that my bit rate was too high and bandwidth hungry. I never knew that the bit rates I set when compressing my videos would have an effect on the bandwidth that would be used. I am obviously showing my ignorance!
    If anyone has anytime to help out someone who has no idea, I would absolutely love to know the answers to these questions:
    1. What is considered a good acceptable frame size to show HD quality footage? Maybe a size that if the quality is OK, they can also stretch the frame afterwards to fill their screen without losing too much quality?
    2. I want to use mp4 with the H264 codec for streaming, what is an efficient bit rate to set the compression at, so that the quality looks nice, but wont drain my bandwidth unnecessarily?
    3. Can anyone explain how the bit rates that I set for my compressions affect the way they are downloaded once they are on a website. Just cant get my head around this logic for some reason?
    4. What other compression settings should I be aware of (eg. keyframes etc)
    I feel so lost in all of this and would appreciate it tremendously if anyone can help me out.
    Dan

    If I select a bit rate of say 2500 to compress my videos at, what will that now mean for the end user? Will that mean that his connection will be forced to download that video at 2500kbp/s thus using alot more bandwidth?
    Yes and no. If the end user has a connection that allows them to receive data at 2500 and the source from the web can supply data at that speed then they'll be able to stream in real time. However, if either end doesn't hold up (the client's connection can't receive data that fast or the source can't send it) then end users will be forced to watch it on delay - letting a good portion of the movie download first. QuickTime will do this anyway - if you (as I do) embed a movie into a webpage, when you visit that page QuickTime will calculate how fast data is being sent and received, and decide when to start the movie based on that calculation.
    I was told that the bit rate I set when I compress these files locally on my machine, tell the streaming software how to allow users to download them - is that true or have I got all mixed up?
    You keep saying streaming and I'm not sure exactly what you mean. Streaming can either mean having a finished file on the web that people can watch with minimal downloading in advance, or streaming can mean sending a live event out over the web. I think you mean the first. In that case, there is no streaming software on the server side - it's just a file that gets sent to a client just like any other file. The bitrate however does tell the client software, like QuickTime player when to start playing the movie (As I alluded to above).
    If you really want to "stream" content - in other words allow people to go to page and start watching then I'm going to suggest you distribute in multiple formats. QuickTime has a number of presets you can use for "streaming", and these are usually small (320*240 or 640*480) videos that are under 1 Mbps (often less than 500 kbps). These files can normally be watched in real time by most clients.
    The other catch with the route you're going is that some computers simply can't handle 720p content that is encoded in h.264 - they just don't have the power. If you look at podcasters many of them have chosen to go multiple formats in part for this reason - they have video embedded on their websites for watching in real time, small iPod formats for lower-power computers and iPods, and HD formats for platforms like the Apple TV that offer the best quality.

  • Can I recover photos no longer in my photo stream

    I was recently travelling in the USA and my iPad was showing a lack of storage space despite there being plenty, I went to the Apple store in downtown SAN FRANCISCO and it was decided we could reset it which would wipe everything but the photos I had already taken in Yosemite were already on my iPhone thanks to Photo Stream, what I failed to realise was that because Photostream is constantly updating and has a limit of 1000 photos, my photos which I had failed to save from the stream would disappear furhter into my trip, I AM LEFT WITH ONLY THOSE PHOTOS I put into a WEB Archive. Does any body know if I can recover my lost photos or are they lost in the CLOUD forever

    what I failed to realise was that because Photostream is constantly updating and has a limit of 1000 photos, my photos which I had failed to save from the stream would disappear furhter into my trip,
    So you did not import the photos from the Photo Stream to your iPhone? If the Photo Stream has not been automatically downloaded to a device, there is no way to retrieve the streamed photos that are no longer in iCloud. The Photo Stream is only a temporary buffer for downloading, not a permanent cloud storage.
    You could try data recovery tools to recover the photos from your iPhone, but that will be expensive with uncertain success. It will largely depend on how much mememory your iPhone has.  I never tried any of the iPhone data recovery tools.

Maybe you are looking for

  • HTTPS sites only show a white box in "top sites".

    I have been trying to add some of my secure sites to "Top Sites" in Safari 4.0.4 but they only show as a white block without any kind of preview. Is there any way to fix this? Message was edited by: soulknight

  • Making a flash movie delay before starting for the first time

    Flash noob here. I've currently got a little bit of actionscript in my flash movie which makes it loop a couple times, and then pause, before looping over again, and then pausing again, and wash-rinse-repeat, which is fine. But now what I also need i

  • Partially apply a visual attribute to an item

    Is there any way to partially apply a visual attribute to an item? Currently, I do not have commas for my number formats and of course, now it is required. I am limited for space and adding the comma's will cause design layout issues. I was trying to

  • Acrobat X preflight

    Hi, I have created a preflight droplet but when pdf's are preflighted they increase in size, why would this be? It is every pdf, even ones without fixes. Do later versions of Acrobat have the same problem? I don't mind upgrading but it would only be

  • I can't upload pictures to an online yearbook I am working on?

    Just last night this started... I am trying to upload pics to onlineyearbooks.lifetouch.com, but when I click "BROWSE" the box never pops up for me to select the pics I want to upload. Help, anyone...