🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.api
Article #87

Re: Problem reading a file generated by a Delphi application

#87
From: Ronaldo
Date: Tue, 05 Apr 2005 12:35
65 lines
4331 bytes
Dear Kevin.
Then I have a serious possession.  
Because the application developed in Delphi uses a format proprietor to record the header, and my problem is exactly to read this header, the compacted data I am not having problem with them, it is enough to ignore the data of the header. But I need to read that header with Java to manipulate the data that were migrated of a legated system, that they are not compacted, but they were recorded with that header. A solution not very elegant it would be to write a .SO in Kylix that makes that work, but I would like to implement a solution purely Java.

I appreciate your help in advance,

Ronaldo.


"Kevin Dean [TeamB]" <NkOdSePaAnM@datadevelopment.com> wrote:
>Ronaldo wrote:
>
>> 
>> Hi all !! My name is Ronaldo. I4m from Brazil.
>> Im having a hard time on reading a file generated by a Software
>> created through Delphi, its not a regular text file, though it is a
>> file that was generated by a component, which main goal is to
>> compress any file using a Zlib, and then to save the bytes from that
>> compressed file as binary fields. That was just a brief introduction
>> so as you can have an idea of the general issue My real problem is
>> reading the header and the footer generated by that component (I do
>> not have any problem in reading and decompressing the data compressed
>> with Zlib). At that header, there is information, such as backup
>> title, size of the backup title, total bytes from the original file,
>> total files in backup, the size in bytes of the path + name of the
>> file that was compressed, path + name of the file compressed, date &
>> time of last update on that file, and a signature EC2 or ECS,
>> where the first one indicates that the content is compressed, and the
>> second one indicates that is not The component writes some data with
>> more frequency; if I manage to read those, I think Ill be able of
>> reading the others. I created a Delphi code very simple in order to
>> generate that header, and another one, to read it. I did the same in
>> Java. However, what I generate in Delphi, cannot be read in Java, and
>> vice versa.  Im going to leave here the source codes in Java and
>> Delphi, in case someone can help me out. Probably somebody already
>> passed through this issue, or at least knows both languages.
>> 
>> I appreciate your help in advance, and apologize for the size of this
>> message.
>
>Without going into your code in too much detail, I would guess that the
>problem you're experiencing is byte order.  Delphi is Intel-based and
>so writes/reads the low byte first; Java is platform-independent and
>writes/reads the high byte first.
>
>I strongly suggest that if you're trying to write code to read a ZIP
>file that you start with a known good ZIP file, run it through the
>Delphi and Java readers, and determine which one breaks.  Creating a
>file with one language and reading it with another doesn't tell you
>which one is at fault; you need the independent arbiter of a known good
>ZIP file.
>
>-- 
>Kevin Dean [TeamB]
>Dolphin Data Development Ltd.
>http://www.datadevelopment.com/
>
>NEW WHITEPAPERS
>Team Development with JBuilder and Borland Enterprise Server
>Securing Borland Enterprise Server
>http://www.datadevelopment.com/papers/index.html
>
>Please see Borland's newsgroup guidelines at
>http://info.borland.com/newsgroups/guide.html
Technical Details
Message-ID: <4252780e$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!npeer.de.kpn-eurorings.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <42515016@newsgroups.borland.com> <xn0e0lmi7194rjq005-kdean@www.teamb.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 1089d0,e0d9b07a5e544a79
X-Google-Attributes: gid1089d0,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Ronaldo" <rsv29@hotmail.com>
Sender: "Ronaldo" <rsv29@hotmail.com>
Reply-To: "Ronaldo" <rsv29@hotmail.com>
Subject: Re: Problem reading a file generated by a Delphi application
Newsgroups: borland.public.jbuilder.java.api
X-User-Info: 201.1.68.117     
References:  <42515016@newsgroups.borland.com> <xn0e0lmi7194rjq005-kdean@www.teamb.com>
NNTP-Posting-Host: 207.105.83.66
Message-ID: <4252780e$1@newsgroups.borland.com>
Date: 5 Apr 2005 04:35:42 -0800
X-Trace: newsgroups.borland.com 1112700942 207.105.83.66 (5 Apr 2005 04:35:42 -0800)
Lines: 66
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!npeer.de.kpn-eurorings.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail