You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by IndianAtTech <in...@gmail.com> on 2005/12/09 09:06:41 UTC

Reading Word Document

Hi All,

I am trying to understand the word document format.

But it seems I am missing somewhere in identifying the FIB block,

After moving to the 24th byte, I am not getting the exact values. I do not
why. In order to check whether I am doing the right thing or not I have
written below test program for which I am getting alswys some unknown
values. Even for the small files also fcMin position value is showing bigger
than the actual file size

import java.io.*;
class  WordTest
{
    public static void main(String[] args)
    {
        try {
            for(int i=0;i<Integer.parseInt(args[0]);i++)
            {
        File f = new File("c:\\a.doc");
        RandomAccessFile raf = new RandomAccessFile(f, "r");
          raf.seek(i);
         // System.err.println(raf.readByte()+" "+raf.readByte()+"
"+raf.readByte()+" "+raf.readByte());
         System.err.println(i+" "+raf.readInt());
          //0011111000000000
        raf.close();
        Thread.sleep(10);
            }
    } catch (Exception e) {
        throw new RuntimeException(e);
    }
    }
}


Can anbody give me the answer for this?

Thanks & Best Regards

Re: Reading Word Document

Posted by IndianAtTech <in...@gmail.com>.
On 09/12/05, Rama Subba Reddy <su...@yahoo.co.in> wrote:
>
> pls use POI and see HPWFDocument. you can understand easily
>
> *IndianAtTech <in...@gmail.com>* wrote:
>
> Hi All,
>
> I am trying to understand the word document format.
>
> But it seems I am missing somewhere in identifying the FIB block,
>
> After moving to the 24th byte, I am not getting the exact values. I do not
> why. In order to check whether I am doing the right thing or not I have
> written below test program for which I am getting alswys some unknown
> values. Even for the small files also fcMin position value is showing
> bigger
> than the actual file size
>
> import java.io.*;
> class WordTest
> {
> public static void main(String[] args)
> {
> try {
> for(int i=0;i {
> File f = new File("c:\\a.doc");
> RandomAccessFile raf = new RandomAccessFile(f, "r");
> raf.seek(i);
> // System.err.println(raf.readByte()+" "+raf.readByte()+"
> "+raf.readByte()+" "+raf.readByte());
> System.err.println(i+" "+raf.readInt());
> //0011111000000000
> raf.close();
> Thread.sleep(10);
> }
> } catch (Exception e) {
> throw new RuntimeException(e);
> }
> }
> }
>
>
> Can anbody give me the answer for this?
>
> Thanks & Best Regards
>
>
> ------------------------------
> Yahoo! India Matrimony <http://yahoo.shaadi.com>: Find your partner now.
>
>