How can I tell if an Object Input Stream has more objects to read?

I have a utility that I'm working on where objects are sent via the network as a complete file. I read the objects, update some, and send them back. I never know how many objects are in the file. I cache the file locally prior to performing this operation. It runs in a chron job.
Currently I am reading until I get an EOF exception. Is there a better way? I've tried available() but it is always returning me zero.
Thanks.
ST

The API says:
Any attempt to read object data which exceeds the
boundaries of the custom data written by the
corresponding writeObject method will cause an
OptionalDataException to be thrown with an eof field
value of true.
Hope this helpsThis doesn't help at all. It refers to what happens while you are reading a single object, not to what happens when you try to read a new object. You will not get this exception between objects.
If as I suspect you are reading from a socket you really have no choice but to try the read, maybe with a timeout. EOF is the only condition that can reliably indicate that there are no more objects in this stream.

Similar Messages

  • How can you tell if your podcast is streaming or if you're playing from a download?

    Yesterday I downloaded a podcast with the new Podcasts app on my iPhone. To play the podcast (while away from my WiFi), I tapped the episode in the Episodes list. I assumed I was playing the downloaded version. This morning, when I checked my data usage, it was 87MB more than it was yesterday! Does this mean that I inadvertently STREAMED the podcast instead? How can you tell?

    This is the itunes forum.  Your question seems to have nothing to do with itunes.
    Basics from the manual are restart, reset, restore.  Try those.

  • Howe can I tell when there are no references to an object?

    Hi all,
    Is there any way for me to know when there are no references to an object without using finalize()?
    I want to pool created objects when it is safe to do so.
    finalize() won't work since it is called only once for every object instance.
    Regards,
    Marcus

    If you are trying to establish an object pool by placing the objects back in the pool when there are no references to the object, then I am afraid you are out of luck.
    If there were no references, then you would not have a "handle" on the object to be able to manipulate it in any way (like putting it back in the pool).
    If you are talking about something else, then the classes in java.lang.ref.*, might be of use.
    If you are really trying to pool objects, then you should have some sort of "close" method in the objects that is called when they are no longer needed and can be returned to the pool.

  • How can I tell that a default numeric format has been applied to a numeric limit step?

    I am working on generating custom HTML code for our test systems in order to reduce the 'footprint' of the standard HTML entries for numeric limits, multiple-numeric limit steps etc....
    For a Numeric Limit step, I can set the Numeric Format via the 'Limits' tab and select the pulldown arrow to select any format.  Does TestStand actually save this information with the step so I could possibly use this later?   I ask this because my modifications are within the 'ModifyReportEntry' Callback.   When I am modifying the code to generate new HTML within this callback, I have no idea if the developer has selected a Numeric Format for a given step OR simply left it as DEFAULT.
    To make matters more confusing, here is some more information....
    When I pause the execution in the callback I notice the following:
    Case 1:  User has selected a Numeric Format ( this example I will say 3 digits of precision ) %.3f. for a numeric limit step.
    Parameters.Result.Limits.Low = 10.000
    Parameters.Result.Limits.High = 20.000
    Parameters.Result.Numeric = 15.657
    Notice the numeric data is ALREADY formatted! Great, I can simply use this to generate my custom HTML table for the numeric limit step.
    Case 2 : User has left the numeric format to <Default> for the step.
    Parameters.Result.Limits.Low = 10
    Paramters.Result.Limits.High = 20
    Parameters.Result.Numeric = 15.65713515155
    Numeric data is NOT formatted.  I know that TestStand will apply the Default Numeric Format that is configured in the report options when it writes the report but since I am doing a custom report I am stuck.
    My question is how can I possibly tell that the data has already been formatted by TestStand in the ModifyReportEntry callback?  Is there some flag that I could check or anything?
    I do notice that the Parameters.ReportEntry string contains TestStand's default HTML code for the step and this is already properly formatted.. so as a possible workaround I could 'pick out' the data from this string but this is slow and time consuming.
    Thanks
    PH

    PH,
    You can find out if the numeric format has changed using the TestStand API. I use the following statement in my step's post-expression to find out the numeric format that TestStand uses for the step.
    Step.Limits.Low.NumericFormat
    If the string returned is an empty string, then it is the default format, otherwise, it's the one specified in the string.
    Hope this helps.
    Raj
    National Instruments
    Applications Engineer

  • How can I tell if one of my iBooks has an update available?

    I was listening to a podcast where the author of a particular iBook, which I have purchased, stated that there was an updated version available.
    My questions are:
    Is there some way to know that there is an update to an iBook I have purchased and have installed on my iPad? Maybe someting like the 'Updates' section of the iTunes and App Store?
    Is there some way to tell what version of an iBook I currently have installed?
    Regards,
    John

    Open Termninal.app (which is in /Applications/Utilities/), and type the following (and Return key) in the Terminal window:
    last
    this will show recent logins in reverse time order (from new to old). If the output has too many lines, then
    last | less
    you can use SPACE and 'b' keys to go down/up screen. Hit 'q' to quit less. Or
    last > logins.txt
    then a file 'logins.txt' will be created in your Home folder, and you can open it with your favorite text editor (e.g., TextEdit.app).
    HTH
    PowerMac G4   Mac OS X (10.4.8)  

  • How can I tell if a non-destructive crop has been applied when opening an image?

    I've wrapped my head around how to reclaim the stripped-out portion of an image that has been non-destructively cropped in CS6: click the image with the crop tool, or select Reveal All from the Image menu. Short of doing this every time I suspect that I may have cropped an image, is there anything in Photoshop's interface to tell me at a glance if the image has been non-destructively cropped? I guess I could check the document dimensions in the pop-up status display at the bottom of the window, but I'm looking for something more direct that doesn't make me search.
    2009 iMac 3.06 GHz Core 2 Duo; OS 10.8.1
    Jeff Frankel

    If you primarily edit files from a particular camera, then your idea to set the status box at the lower-left to show the image dimensions is a good one - just watch for dimensions that are not the norm. 
    You shouldn't have to set the readout to Document Dimensions more than once, though...  Open one image, set that field to read Document Dimensions, then close the document and quit Photoshop gracefully.  From now on it ought to read Dimensions when you open a new document.
    I wasn't aware 10.8.1 was out.
    -Noel

  • Is this latest notice from Adobe to update the Acrobat Reader legitimate? How can I tell?

    How can I tell if today's software update from Adobe for Acrobat Reader is legitimate?

    Hi Darrell,
    You can navigate directly to the Adobe site, adobe.com -- getting any downloads directly from Adobe will insure that you are getting the real deal.  I usually get most of my updates through "Apple software update," myself.
    Either way is A-OK.
    Wuz

  • HT1695 How can I tell if my message has been sent?

    I am new to iphone.  I just sent a text message - I think.  How can I tell if it actually went?

    when they respond back.

  • How can i connect 24VDC to digital input (usb 6008)

    hello,
    how can i connect 24VDC to digital input (usb 6008), is it possible with some optocoupler?
    thanks

    The 6008 is a static DIO, so speed shouldn't be an issue.  Therefore an optocoupler should work.  Just make sure you get one the meets your specs.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • How can we tell if a VI is already running before calling Start Asynchronous Call?

    The new Start Asynchronous Call node is awesome for spawning multiple instances of reentrant VIs.  However, I've stumbled a bit in using it for non-reentrant VIs.  The old practice of using the "Run VI" method would allow us to check the Execution.State of the VI before invoking the method to run it.  That way if the State was Running or Run Top Level, we could skip the invoke node and just use a property node to open its front panel.  WIth the Start Asynchronous Call node, it looks like we have to use a strictly typed static VI reference, and when we open the VI reference, the VI gets reserved and its Execution.State = Running.  So, how can I tell if it is not just reserved by the thread but actually executing before making a redundant Start call?
    By the way, the redundant Start has interesting behavior.  It will actually cause the targeted VI to be executed again after it stops.  Even if you hit the Abort button on the target VI, it will immediately execute again and again equal to the number of times the Start Asynchronous Call node was run.  There's nothing wrong with that, and I suppose the simple answer is to just go back to using the old "Run VI" method.  It's just that the ability to wire up those inputs directly to the connector pane is so nice.  Perhaps I am missing something obvious.  Oh, I am referring to the Call and Forget mode (0x80).
    Thanks,
    Dan
    Solved!
    Go to Solution.

    Just throwing it out there, I know I'm a year.5 late on this but if it's a psuedo-modal dialog or some other window that you only want a single instance visible at one time, you can check the FP.State property on the strictly typed vi reference. If it's loaded and visible to the user it will be "Standard", if it was closed or not opened prior then the state will be "Closed".
    I think the standard behavior of serializing execution on another thread would be great for doing a pre-set number of iterations with a sub vi in a non-blocking sort of way but for sub vi's meant for UI interaction checking FP.State works.
    Philip
    CLD

  • How can I tell what table(s) have the most transactions against them

    Hello, in Oracle 11.2.0.3, RHEL 6 x86-64, how can I tell what tables have the highest transaction activity?
    Picked "Objects" because I could not find a space related to performance tuning
    Humbly,

    What version of Oracle are you running (standard or enterprise)?
    Easist system is to run an AWR or statspack report. If you run either of these you will see sections on segments (so segments by logical reads, physical reads) which is easily digestible.
    v$segment_statistics will also give you a breakdown on segment access.

  • How can you tell if you Mac is overheating?

    How can you tell if your MAC is overheating or running too hot?

    Make sure you are using your MBP properly as it is not a "laptop."
    According to the user manual it states in part:
    "Do not operate your MacBook Pro on a pillow or other soft material, as the material can block the airflow vents. Never place anything over the keyboard when operating your MacBook Pro. Never push objects into the ventilation openings."
    MacBook Pro: Care, Use, and Safety Information
    "Do not place your MacBook Pro on your lap or other body surface for extended periods of time. Prolonged body contact can cause discomfort and potentially a burn."

  • How can I tell how much heap space is actually in use by a node?

    How can I tell how much heap space is actually in use by a node? If I pass in ...
    set memory=1024m
    set java_opts=%java_opts% -Xms%memory%
    set java_opts=%java_opts% -Xmx%memory%...then memory usage starts high and stays there. I feel like I don't really know how close I'm getting to exhausting my cluster's memory as I insert objects.
    Thanks,
    Andrew

    Hi
    +(With apologies if I am misreading the question and thus answering the wrong one.)+
    [This agent|http://wiki.tangosol.com/display/COH35UG/Provide+a+Data+Grid#ProvideaDataGrid-NodeBasedExecution] reports how much free and total memory is being used on each node in the cluster.
    Regards
    Pete

  • How can I tell if someone is hacking/keystroking?

    All of my iPhoto disappeared, photo library gone.  Nothing in trash.  Reasons happening in addition to this that lead me to believe I've been hacked.  How can I tell?  How can I find and restore photos?  How do I know if keystroke is on my computer, etc.?  The following is "GREEK to me"
    Last login: Wed Dec 18 23:19:15 on ttys000
    Sarah-MacBook-Pro:~ mckennafamily777$ kextstat -kl | awk '!/com\.apple/{printf "%s %s\n", $6, $7}'
    Sarah-MacBook-Pro:~ mckennafamily777$ sudo launchctl list | sed 1d | awk '!/0x|com\.(apple|openssh|vix)|edu\.mit|org\.(amavis|apache|cups|isc|ntp|postfi x|x)/{print $3}'
    WARNING: Improper use of the sudo command could lead to data loss
    or the deletion of important system files. Please double-check your
    typing when using sudo. Type "man sudo" for more information.
    To proceed, enter your password, or type Ctrl-C to abort.
    Password:
    com.oracle.java.Helper-Tool
    com.microsoft.office.licensing.helper
    com.adobe.fpsaud
    Sarah-MacBook-Pro:~ mckennafamily777$ launchctl list | sed 1d | awk '!/0x|com\.apple|edu\.mit|org\.(x|openbsd)/{print $3}'
    com.oracle.java.Java-Updater
    Sarah-MacBook-Pro:~ mckennafamily777$ ls -1A /e*/mach* {,/}L*/{Ad,Compon,Ex,Fram,In,Keyb,La,Mail/Bu,P*P,Priv,Qu,Scripti,Servi,Spo,Sta} * L*/Fonts 2> /dev/null
    /Library/Components:
    /Library/Extensions:
    /Library/Frameworks:
    AEProfiling.framework
    AERegistration.framework
    AudioMixEngine.framework
    NyxAudioAnalysis.framework
    PluginManager.framework
    iTunesLibrary.framework
    /Library/Input Methods:
    /Library/Internet Plug-Ins:
    Flash Player.plugin
    JavaAppletPlugin.plugin
    Quartz Composer.webplugin
    QuickTime Plugin.plugin
    SharePointBrowserPlugin.plugin
    SharePointWebKitPlugin.webplugin
    flashplayer.xpt
    nsIQTScriptablePlugin.xpt
    /Library/Keyboard Layouts:
    /Library/LaunchAgents:
    com.oracle.java.Java-Updater.plist
    /Library/LaunchDaemons:
    com.adobe.fpsaud.plist
    com.apple.remotepairtool.plist
    com.microsoft.office.licensing.helper.plist
    com.oracle.java.Helper-Tool.plist
    /Library/PreferencePanes:
    Flash Player.prefPane
    JavaControlPanel.prefPane
    /Library/PrivilegedHelperTools:
    com.microsoft.office.licensing.helper
    /Library/QuickLook:
    iWork.qlgenerator
    /Library/QuickTime:
    AppleIntermediateCodec.component
    AppleMPEG2Codec.component
    CamTwist.component
    /Library/ScriptingAdditions:
    /Library/Spotlight:
    Microsoft Office.mdimporter
    iWork.mdimporter
    /Library/StartupItems:
    /etc/mach_init.d:
    /etc/mach_init_per_login_session.d:
    /etc/mach_init_per_user.d:
    Library/Address Book Plug-Ins:
    Library/Fonts:
    Library/Input Methods:
    .localized
    Library/Internet Plug-Ins:
    Library/Keyboard Layouts:
    Library/LaunchAgents:
    com.apple.AddressBook.ScheduledSync.PHXCardDAVSource.D2D97456-F3F1-43ED-A067-6D1 50643E9CA.plist
    com.apple.CSConfigDotMacCert-mckennafamily777@me.com-SharedServices.Agent.plist
    Library/PreferencePanes:
    Sarah-MacBook-Pro:~ mckennafamily777$ osascript -e 'tell application "System Events" to get name of every login item' 2> /dev/null
    iTunesHelper, SpeechSynthesisServer, MenuTab for Facebook, AirServer, TuneupMyMac
    Sarah-MacBook-Pro:~ mckennafamily777$
    Next terminal session to disable air drop
    Sarah-MacBook-Pro:~ mckennafamily777$     defaults write com.apple.NetworkBrowser DisableAirDrop -bool YES
    Sarah-MacBook-Pro:~ mckennafamily777$

    Applications > Utilities > Airport Admin Utility
    Select your Airport Base Station > Configure > Airport Tab
    Change Wireless Security
    Wireless Security Change to WPA
    Choose a password which is at least eight characters long and perferably at least twenty and consists of letters and numbers like this
    gh5ls9irth1278dhtu6w8jf9923j9ds
    Click Ok
    Click Update
    You will be asked for a password the next time you use your wireless network enter the password you created.
    Your wireless network is now secure (for all intents and purposes) against any known hacking.
    iFelix

  • How can I route my audio interface inputs to Logic Express inputs?

    Hello,
    Logic Express can 12 inputs to record audio on.... fair enough.
    My MOTU Traveler, together with ADAT connected Mackie Onyx 800F have 16 inputs...
    How can I use the first 4 inputs (XLR) together with the last 8 input (ADAT)
    Logic only seems to count from 1 to 12!
    (After reading the manual, It seemed to be solved by making new Audio Input Objects in the Environment, but unfortunately these objects where removed from Logic Express)
    Does anybody have the solution?
    Thanks a lot.
    Greetings,
    Mark

    Hi Michael, thanks a lot!
    Unfortunately it didn't solve my problem yet. I tried
    the audio/midi utility and found that the inputs
    can't be turned off. Is there not a environment patch
    possible, that I can load that puts the inputs in the
    right order? I hope so!
    Greetz,
    Mark
    The Environment doesn't route audio; it routes MIDI. There are audio objects IN the Environment, but you can't shuttle audio around like that.
    You have to remember that LE is an entry-level piece of software. You might think Garageband is entry level, and I think it should be, but in reality, LE is VERY crippled. Don't get me wrong, I'm not ragging on Logic as a program; I think Logic is great. But Apple has made some poor choices with respect to the features of LP that get crippled in LE.
    Sorry to digress from your original topic, but I think this is a bigger issue. The difference in price between LP and LE is enormous. That difference should be due to the fact that LP has plugs and effects (and other fairly esoteric features, like surround mixing, that most people don't need), and that justifies the price difference. Remember, when Emagic sold Logic (pre-Logic Pro 6), those effects and instruments cost a LOT more than the difference between LP and LE. LP is really a steal for what you get. LE is a poor substitute.
    Seriously, LE is a lot less than just a lite version of LP; it's crippled by things like the 12 input/output thing (what is the point?), the useless Auxes, and numerous other little things that keep it from really competing with other 'lite' sequencers like Cubase SL or Audiodesk.
    Anyway, I think the answer to your question is, if you need to record more than 12 simultaneous tracks, or you need flexibility in accessing your hardware's inputs and outputs, you need a better program.
    Fortunately, the upgrade cost to LP isn't that much, nor is the crossgrade to Digital Performer...

Maybe you are looking for

  • Where is the Popup Menu in ACR 9?

    After installing ACR 9, I don't see the Popup Menu on top of the Firmstrip. All I see are the "Select All" and "Synchronize...". Right clicking on the firmstrip is not doing anything. Thank you.

  • Creating new DMS info record directly from purchase order transactions

    Hello Everybody, does anyone knows of a way to make it possible for users to Create New DMS info record directly from the purchase order transactions ? e.g: in ME22N there is a button of "Documents" for an item level in the order, but that button onl

  • Two dynamic ALV grid

    Hi experts,   I am having a dynamic ALV grid. How to create a new grid(second grid) in the same page with different values? Thanks&Regards, vino

  • No Matching records found

    Hi All When a user trying to select or choose little yellow arrow of the document to approve in the message/alert window why the system displays "No Matching records found "(WDD1) (ODBC-2028)" Other Info SAP B1 2007B Patch level 14.  All the approval

  • Help with setting up microcell-time capsule-dsl

    how do i set up time capsule with motorola nvg510 router and microcell by at&t