Finding end of file

hello, i've got a file with a collection of different data types that must be read in, they all are consistent though being
long
string
int
long
string
int
long
string
int
ect.ect.
my question? how can i find the end of file? in the past i've caught the null in a string but null cannot be applied to long.. so i get a numberformatexception.. is there a good way around this?

is there a good way around
this?Presumably you are reading serialized objects althoughh that doesn't particularily matter.
Not really.
Strings are dynamic. So there is no way to know the correct size without actually reading it.
You can get the length of a file though (see java.io.File.) If you then read the file as an array (or 'chunks') then you can always write the read loop such that it will never read beyond the length of the file.
Of course the best way would be to change the source of the file. Given that you are writing groups of data, if the source was to put the number of groups at the beginning of the file it would make it a lot easier.

Similar Messages

  • How do I find a corrupted file in a backup folder on my computer?

    I have recently had to replace the battery in my iphone, but before doing so, I had backed up the phone about 3 times, all saying they were successful.  And then I had erased the phone(before I realised the battery was the problem).  However when I went back to restore from the backup, it says that it cannot be restored because the backup is corrupt.  I read on one site that sometimes if a phone turns off or disconnects while backing, it might cause a corrupt file, and I think that's exactly what my phone did due to the battery issues.  The big question is, is it only specific files inside the backup folder that are corrupt?  And how do I find out which files they are?  Please help.

    Hi
    This can be an issue on other end ( server end ) as export to HTML works fine so Muse is exporting the files correctly but while exporting to external server if it stuck then we should check on server side if there is any problem related to specific file upload.
    As a workaround, you can use any FTP client and then upload the exported html files to root location.
    Thanks,
    Sanjit

  • ORA-03113: end-of-file on communication channel while executing a query

    Hi all,
    I am getting following error while executing one of the query.
    ORA-03113: end-of-file on communication channel
    The query involves subqueries. At one point, in the second last condition of the whole query is the cause. what makes the query to disconnect from database.
    I am pasting the whole query with highlighted part causing the error.
    select
    A.Num_Employee_Id as col_0_0_,
    A.Str_Name_For_Reports as col_1_0_
    from
    Est_Esb_employee_m A
    where
    A.num_office_id=1
    and A.Num_Employee_Id not in
    (select
    B.Num_Employee_Id
    from
    Est_Esb_Employee_Service_D B
    where
    B.Chr_Curr_Status='N'
    and
    B.Dat_Effective_Date is not null
    and
    B.Dat_Effective_Date=
    (select
    max(C.Dat_Effective_Date)
    from
    Est_Esb_Employee_Service_D C
    where
    C.Num_Employee_Id=B.Num_Employee_Id
    and C.Dat_Effective_Date is not null
    and B.Num_Transaction_Id=
    (select
    max(D.Num_Transaction_Id)
    from
    Est_Esb_Employee_Service_D D
    where
    D.Dat_Effective_Date=
    (select
    max(E.Dat_Effective_Date)
    from
    Est_Esb_Employee_Service_D E
    where
    Num_Employee_Id=D.Num_Employee_Id
    and D.Num_Employee_Id=B.Num_Employee_Id
    and B.Num_New_Office_Id=1
    order by
    A.Str_First_Name,
    A.Str_Middle_Name,
    A.Str_Last_Name
    Awaiting your valuable suggestions.
    Regards
    Vijay Kumar

    I would start by compareing the explain plan of both versions of the statement.
    Also by adding such a restriction you might change from an uncorrelated subquery to a correlated subquery. I'm not sure, because your code is hardly readably without formatting.
    In any case you seem to select again and again from the same table. Maybe you should find a way to optimize to query in terms of io (less table access). Then this problem could go away.

  • Error while starting the server - Unexpected end of file from server|

    Hi,
    I am getting below error when I start my glassfish server.
    SEVERE|sun-appserver2.1|com.stc.emanager.deployment.sunone.model.runtime.ServerRuntimeModel|_ThreadID=86;_ThreadName=httpWorkerThread-4048-3;_RequestID=8d1f2acd-9e4e-4e9f-a9fd-3b21e4223318;|Unexpected end of file from server|#]
    I see the process is running. But, I am not able to open admin console.
    could any one plz help me to resolve this issue.
    Thanks in Advance,
    -Manandi

    Welcome to the forum.
    Unfortunately for you, posting only about things not working isn't going to net you assistance or answers - at most you can get sympathy but there isn't too much of that to share with everyone. You should find a forum for the particular product that is not working. If you have a problem with Glassfish, then try the Glassfish forum.
    http://www.java.net/forums/glassfish/glassfish

  • End of file 16072 error encore V 1.5.1.42735

    I've been at this awhile and usually don't have much trouble so this is beginning to make me a little cranky.  I used to get this error once in a while for the usual reasons (vid and audio not same length and mismatch on time/duration on animated buttons).  Latley it has started to come up on every single project and seems way random.
    Here is the typical scenario.  I Export a dozen or so movies from PPro 1.5 at MS DV AVI.  I import as timeline in Encore 1.5.1.  I use automatic transcode and  build the DVD as an image on my HD to test.  I get the end of file 16072 error.
    This is how a I trouble shoot.  I create a new Encore project called test.  I import the .m2v and the .wav files from the Transcodes folder of the Encore project one at a time.  In this way I avoid retranscoding the movie saving a little time. The test project has no menus or buttons and only one timeline set as first play.  I build a dvd image on my HD one at a time until I get the same error in the "test" project.  I then go back in PPro and work on the the Timeline that I exported the movie from.  Sometimes I can just delete the last clip from the timeline and the error goes away.  Then I edit the last clip back in, re-export and retest it.  Most of the time it is then OK.  If it is  I then bring it back into the Encore project I was working on in the first place and works.  Other times that does not work and I can keep going back one clip at a time until I find the problem or sometimes it is just quicker to re-edit the whole section of source material into a new timeline.
    The project I am working on right now started out as seven hours of DV.  I am working on the third DVD I created from it after editing down to about three hours of final footage broken up into about 36 timelines.  This last Encore project has 14 timelines and three of them produce the error when testing.  I just fixed one of them by deleting the last clip and testing.  The other two are next up but jeeze this is getting old.  No motion menus or animated buttons.  The problem is with the .avi as in the test project I use it is the only timeline and set to first play with no menus or buttons.
    I am looking for some informed advice from someone who has specific experience with this error and has whipped it.  I have read more than a few posts from people that have gotten this error and with most it is because the material they are working with has caused it with good reason.  That does not seem to be the case with my projects.  I edit the same way, export the same way from PPro.  I import in Encore and build basically the same project over and over.   Why would I get this seemingly random error.  Can I avoid it?
    I have the Adobe Video Collection Professional, paid a ton for it and it does everything I need.  I can't upgrade with out building an entirely new system to run the new software anyway and the money is not there for it.
    I have 39 hours of video I need to edit into hundreds of timelines and this error is eating me alive.  This latest project with 7 hours has had days added to it because of this error.  Please help me learn solve ar avoid it.
    Thanks in advance,
    Mark

    I wonder if there could be some slight Durational difference between the muxed streams, since the Audio is in Audio Units and the Video is in Timecode. Just a sliver of difference *could* yield a problem.
    I've read of similar with other muxed sources but never a definitive answer on why En does not pick up and correct this, or how it could occur with the Export from PrPro, or other NLE. Still, it does seem to happen on occasion.
    Also, I usually have a bit of Black Video at the Head, and then some at the Tail, so in PrPro, my Video Timeline is always a bit longer, than my Audio Timeline. As there is no Audio signal at the end, PrPro can deal with it perfectly. Will have to try some muxed sources (not my normal workflow) to see if there is something else afoot.
    Just thinking here,
    Hunt

  • Unable to display tree view; Error when parsing an XML document (Premature end of file.)

    Hi folks,
    I am using a cascaded mapping in my OM. I have a graphical mapping followed by the Java mapping. It is a flat file to IDOC mapping. Everything works fine in Dev but when I transport the same objects to QA, the Operation mapping though it doesn't fail in ESR testing tool, gives the following message and there is no output generated for the same payload which is successfully tested in DEV. Please advise on what could be the possible reasons.
    Unable to display tree view; Error when parsing an XML document (Premature end of file.)

    kalyan,
    There seems to be an invalid xml payload which causes this error in ESR not generating the tree view. Please find the similar error screenshot and rectify the payload.
    Mutti

  • End-of-file in communication channel while querying the data

    We are using ColdFusion(Windows) to access an Oracle - 8.1.7
    database. I have context indexes setup on the data for search
    purposes.
    If I use a package to query the database and return some values,
    when many people use the call to the package I get the following
    error:
    End-of-file in commnuication channel
    And many other users lose connection to the database. The
    database, however does not go down.
    The same logic works well on the development database where
    traffic is less.
    If we replace the stored proc call by the individual sql
    statements there are no problems. Due to complexity of the
    program, I would like to use stored procs instead of sql
    statements in the ColdFusion code.
    Does anyone have any suggestions?

    07445:exception encountered:core dump [kopedga()+200] [SIGSEGV]
    [Address not mapped to object] ....
    ORA-7445 is a core dump (segmentation fault) and is a bug in the
    database.
    You have now the following options:
    If you have metalink access:
    1. You can have a look if you find a bug entry and then see
    when it will be fixed (e.g. search for 'ORA-7445 kopedga').
    2. Create an iTAR in Metalink.
    If you don't have metalink access:
    3. Use the latest patchset and try again and hope that it is
    fixed.
    Regards,
    Thomas

  • How to find number of files in a folder using pl/sql

    please someone guide as to how to find number of files in a folder using pl/sql
    Regards

    The Java option works well.
    -- results table that will contain a file list result
    create global temporary table directory_list
            directory       varchar2(1000),
            filename        varchar2(1000)
    on commit preserve rows
    -- allowing public access to this temp table
    grant select, update, insert, delete on directory_list to public;
    create or replace public synonym directory_list for directory_list;
    -- creating the java proc that does the file listing
    create or replace and compile java source named "ListFiles" as
    import java.io.*;
    import java.sql.*;
    public class ListFiles
            public static void getList(String directory, String filter)
            throws SQLException
                    File path = new File( directory );
                    final String ExpressionFilter =  filter;
                    FilenameFilter fileFilter = new FilenameFilter() {
                            public boolean accept(File dir, String name) {
                                    if(name.equalsIgnoreCase(ExpressionFilter))
                                            return true;
                                    if(name.matches("." + ExpressionFilter))
                                            return true;
                                    return false;
                    String[] list = path.list(fileFilter);
                    String element;
                    for(int i = 0; i < list.length; i++)
                            element = list;
    #sql {
    insert
    into directory_list
    ( directory, filename )
    values
    ( :directory, :element )
    -- creating the PL/SQL wrapper for the java proc
    create or replace procedure ListFiles( cDirectory in varchar2, cFilter in varchar2 )
    as language java
    name 'ListFiles.getList( java.lang.String, java.lang.String )';
    -- punching a hole in the Java VM that allows access to the server's file
    -- systems from inside the Oracle JVM (these also allows executing command
    -- line and external programs)
    -- NOTE: this hole MUST be secured using proper Oracle security (e.g. AUTHID
    -- DEFINER PL/SQL code that is trusted)
    declare
    SCHEMA varchar2(30) := USER;
    begin
    dbms_java.grant_permission(
    SCHEMA,
    'SYS:java.io.FilePermission',
    '<<ALL FILES>>',
    'execute, read, write, delete'
    dbms_java.grant_permission(
    SCHEMA,
    'SYS:java.lang.RuntimePermission',
    'writeFileDescriptor',
    dbms_java.grant_permission(
    SCHEMA,
    'SYS:java.lang.RuntimePermission',
    'readFileDescriptor',
    commit;
    end;
    To use:
    SQL> exec ListFiles('/tmp', '*.log' );
    PL/SQL procedure successfully completed.
    SQL> select * from directory_list;
    DIRECTORY FILENAME
    /tmp X11_newfonts.log
    /tmp ipv6agt.crashlog
    /tmp dtappint.log
    /tmp Core.sd-log
    /tmp core_intg.sd-log
    /tmp da.sd-log
    /tmp dhcpclient.log
    /tmp oracle8.sd-log
    /tmp cc.sd-log
    /tmp oms.log
    /tmp OmniBack.sd-log
    /tmp DPISInstall.sd-log
    12 rows selected.
    SQL>

  • HELP! 'unexpected end of file' error-Is there a fix?! OS 10.4.11

    Getting 'Unexpected end of file' error when trying to open a file (that's a rush job) in QuarkXpress 6.5.  I attributed it to lack of memory, so I immediately backed up all files and HD to an external drive to free up space. Restarted and prayed... Quark launched, but file won't open. Same error.
    Have: 2.1 GHz PPC G5, 1.5 GB DDR2 SDRAM  OS 10.4.11 (pre Intel)
    Capacity: 232.8GB, Available: 163GB, Used 69.6GB
    Have been searching help site for 5 hours looking for answer and am DESPERATE!  I saved changes regularly, but can't access this file at all... I've lost 2 full days & nights working on this project that has to be done in 2 days.
    Ran Disk Utility, but no success opening this specific Quark file (Quark will launch- it's just this file that's affected).  Have tried to down load Applejack, etc. but keep finding out they only support OS 10.5 or higher.  (Haven't been able to afford upgraded system since Intel requires purchase of full verions of graphics software instead of upgrades to the tune of $6k).
    PLEASE, I only know enough to be dangerous, so ANY help is GREATLY APPRECIATED! 
    Savvy folks- if I'm in the wrong place, please send me a link where I can solve this personal catastrophy.
    Many thanks-in-advance

    I think you best do over your work from scratch.  You need to make backup copies of the files regularly.  You need to have copies on multiple disks or flash drives.
    I saved changes regularly
    You should know that this isn't sufficient. You need to have multiplte copies of the file.  Backup anyone?  Could be the file structure got messed up.  Could be Quark messed up the file.
    You need to get a newer machine.  G5's are not reliable any more.  Need to see if Quark will run in compatiblity mode on an intel machine.  You should at least get an external firewire drive from owc.  Old hd's are not reliable.
    Boot in safe mode. Hold down the shift key when powering on the machine. This will run a disk repair program. Boot up will take longer as the harddrive is scanned and repaired.
    See this article:
    http://docs.info.apple.com/article.html?artnum=107393
    Or from:
        mrtotes article  :
        Boot from the OS X Install disk and from the Menu Bar choose Disk Utility. Then run "Repair Disk" and "Repair Disk Permissions" on your hard disk.
        a brody:
        https://discussions.apple.com/docs/DOC-1689
    Here the apple article on booting single user mode and using fsck. See the section on Use fsck:
    http://docs.info.apple.com/article.html?artnum=106214
    I suspect not but Perhaps Disk Warrior will be of some help:
    http://www.alsoft.com/DiskWarrior/
    Robert

  • End of file error 39

    Good afternoon.
    I recently downloaded a bunch of movie trailers using the "View Source" method (viewing the source of the display page and finding the URL). When I went to open them in Quicktime 7.0.2, they would not display. I received an error saying "The end of the file has been reached (-39)." Is there some sort of tag or piece of code inserted in such trailers so they won't play after being downloaded?
    Aslo, when I view the information for the .mov files, they're only 2 or 4 kb. As I recall, this means they're "pointer" files, and I have to open them in BBEdit to get the true URL? Does anyone know anything about this?
    Thanks for any help you can give.

    Update: I installed a trial version of BBEdit, along with the command-line tools, and tried to open some of the trailers. I received this error message:
    "An unexpected end-of-file was encountered (MacOS Error code: -39)"
    There is one trailer that works in Quicktime, and its file name contains the tag "meta". Does this have anything to do with it?
    After discovering the original problem (the trailers wouldn't play) I redownloaded two of them from a different source. When I open them in BBEdit, the movie clip comes up, not any code.
    Can anyone help me? Thanks.

  • SAXParseException: premature end of file in creating WARs

    Hi,
    I stronlgy follow the hints provided in J2EE tutorial to create some WARs from sample code,
    all is OK with compiling, however when I save my work (where ir is required in text), I get the following
    message
    ....WAR is corrupt or cannot be read
    SAXParseExcpetion: Premature end of file
    Where is cause for this? Additionally - when I try to install provided wars, all is OK (resp. I think that my installation work - J2EE 1.4 beta 2)
    Well during creating wars there is some reports about some bug which prevents to write URL directly during creation of war - could the cause be hidden here?
    Thanks for replies

    but I feel that .xml files should be correct - I try
    build samples and I get this error both for web
    applications and web service applications.Doesn't matter what you feel or assume. Are they correct or aren't they? The web and SOAP servers seem to think something's wrong. You ought to be checking all the XML that they touch to find out what's bothering them.
    I can't say that I know, but if you're getting a SAX parse exception an invalid web.xml will do it. They've got to be valid against the DTD for the web.xml. Have you verified your web.xml against the DTD? Will a browser or an app like XML Spy validate it for you?
    If you've checked it and found that it's okay, then I'm incorrect and you need to look at something else. But "feeling" that they're right isn't the same thing as being 100% certain because you've had a tool validate it against the DTD.

  • Premature end of File

    Hi all,
    I got the following exception while doing file to file scenario  (with file content conversion)
    Operation Mapping
    INF137917_OM_Medicine
    Runtime error
    Runtime exception occurred during application mapping com/sap/xi/tf/_INF137917_MM_Medicine_; com.sap.aii.utilxi.misc.api.BaseRuntimeException: Premature end of file.
    I found this error in test configuration of Integration directory.
    Please help me to find out the cause of it.

    Hi Ashu,
    With what payload you are testing in the ID test tool? Should be from the SXMB_MONI ,isn't it ?
    My view is that , there are error in the sender file adapter FCC which you have written.
    Please try correcting the FCC error and your issue will be solved.Make sure you use correct parameters as FCC is case sensitive.
    refer this help.sap link to analyse and correct your fcc error.
    http://help.sap.com/saphelp_nw70/helpdata/en/2c/181077dd7d6b4ea6a8029b20bf7e55/content.htm
    post if you have any specific erorr, as you seems to be very new to SDN , try searching for the error in Google/SDn and then if you dont get any way out ... SDN members will be more than happy to guide you .
    Cheers,
    Srinivas

  • "End of File" error 4 when trying to use Advanced TDMS Palette to create a circular file buffer

    I'm using the Advanced TDMS palette to create an on-disk circular buffer. I was able to successfully implement the buffer for a single channel of data.
    However, when I try to write multiple channels of data, I continuously get "End of File Encountered" error 4. I am pre-allocating 60,000 data points for each channel using the "TDMS Set Channel Information" function.
    I am able to (1) Set Next Write Position and (2) perform an Asynchronous Write to the first channel. But when I try to Set Next Write Position to the second channel, I immediately get an error 4.
    The examples have not been helpful as none of them write to different channels in sequence.
    Attached is an example project of what I'm trying to do, coded in 2013SP1.
    Sorry about the file hierarchy, the project is located in the ZIP file here:
    Workspaces\V12000\_V12000 Common Labview Code\Named WF Array\Named WF Array.lvproj
    http://linkd.in/mikele
    Attachments:
    Named WF Array Project.zip ‏1500 KB

    I looked into your project and found that the error comes from Set Next Write Position because the "offset" passed in is out of range. In fact, for continueous logging, you don't need to put the Set Next Write Position in front of the write. Remove this function and you will find your VI can run successfully without throwing out any errors.

  • End of file reached unexpectedly

    When I try to save PDF files created from an online journal, I receive the message:  End of File was Reached Unexpectedly.  I have tried saving the files to different locations, but get the same message.  This happens with several files and I have been unable to find a way to remedy the problem.  Any help anyone can provide is appreciated.
    Thanks!

    Great. I'm glad it worked. Others have said you have to clean the cache in Chrome (too much trouble for me)
    MdelC
    Date: Mon, 6 Jul 2009 23:17:44 -0600
    From: [email protected]
    To: [email protected]
    Subject: End of file reached unexpectedly
    Thank you!  I was using Google Chrome - opened it in Explorer and problem solved.
    >

  • Getting end-of-file on communication channel error on this query

    Hi guys,
    I'm getting the end-of-file on communcation channel error when running the following query in SQL PLUS, If run it in a stored procedure called through code of JDBC, it gave "no more data to read from socket" error. Any idea what went wrong? kind of frustrated now. We are using the Oralce 9.0.1.4.0, which suppose to fix some sdo_uion and sdo_buffer bugs. Thanks a lot!!
    select SDO_GEOM.SDO_BUFFER((SELECT SDO_AGGR_UNION(MDSYS.SDOAGGRTYPE(GEOLOC, 0.011119487)) FROM GEOTEL_SOURCE where MSA='5000' and COMPANY_NAME ='AMERICAN FIBER SYSTEMS'),1.0,5,'unit=MILE arc_tolerance=0.05') from GEOTEL_SOURCE a where a.MI_PRINX = 1;

    Hi Daniel,
    Just tried the 9.2.0.2 patch, seems to work better now. At least I don't get the end-of-file on communication channel error. But how about the speed thing? I isolated the problem, and find out that sdo_aggr_union is taking too long to finish( 1 Hour!!! for 2300 lines with the same city. Any clue to optimize it, I tried some hint like /*+ordered*/ No_Merge and something like that, does not improve though. Thanks!                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Maybe you are looking for

  • In R/3 display smartform as pdf in a custom container

    Hello, I want to display smartform as pdf in a custom contianer . I was able to find all the right code from sdn. but my problem is that when executed my sap gui is closed without any error. I am unable to understand what is going wrong.   CALL METHO

  • Receiver XI Adapter: HTTP Port

    Hi All, Receiver XI Adapter: I have access to this system thru SAP GUI. Where can the below details be found? 1. Target Host:         Specify the host name of the receiver system. 2. Service Number:   Specify the HTTP port. 3. Path prefix? Kindly hel

  • Attachments for a Custom Inquiry Form

    Hi i want to enable view only attachment image for a custom inquiry form based on the standars Oracle apps table. In the Oracle apps form, the attachment is enabled and users are able to use the attachment functionality. In the framework page, i trie

  • My Macbook Pro won't turn on even though the batt seems fully charged?

    My Macbook seems fully charged but nothing happens when I press the on button. All the lights on the battery are illuminated... Any help would be appreciated! Cheers, ET

  • Recovered photos from bad driver, but files are .ithmb, & won't convert!!!

    Hi, .. My hard-drive was damaged, and Time Machine backed-up everything on the external drive, except my second iPhoto Library, called iPhoto Library-2, .. and Genius Bar couldn't find the reason, nor could they fix it. For some reason Time Machine j