Class DwgFileVR2004Reader

java.lang.Object
org.gvsig.dwg.lib.readers.DwgFileVR2004Reader
All Implemented Interfaces:
IDwgFileReader

public class DwgFileVR2004Reader extends Object implements IDwgFileReader
Author:
alzabord TODO To change the template for this generated type comment go to Window - Preferences - Java - Code Style - Code Templates
  • Field Details

  • Constructor Details

    • DwgFileVR2004Reader

      public DwgFileVR2004Reader()
  • Method Details

    • read

      public void read(DwgFile dwgFile, ByteBuffer bb) throws IOException
      Reads the DWG version 2004 format
      Specified by:
      read in interface IDwgFileReader
      Parameters:
      dwgFile - Represents the DWG file that we want to read
      bb - Memory mapped byte buffer of the whole DWG file
      Throws:
      IOException - When DWG file path is wrong
    • readDwgR2004InfoSection

      protected void readDwgR2004InfoSection(ByteBuffer bb)
    • readDwgR2004FileHeader

      protected void readDwgR2004FileHeader(ByteBuffer bb)
      This function reads the header section of the file, with the encrypted data
      Parameters:
      bb - ByteBuffer containing the opened DWG file
    • readSection

      protected ByteBuffer readSection(ByteBuffer bb, String name)
      Parameters:
      bb -
      name -
      Returns:
      the decompressed data of a logical section, joining up all the physical sections belonging to it .
    • readDwgR2004Objects

      protected void readDwgR2004Objects()
      Reads all the object referenced in the object map section of the DWG file (using their object file obsets)
    • readDwgR2004Object

      protected DwgObject readDwgR2004Object(ByteBuffer bb, int offset, int index)
      Read commun parameters for an Object
      Parameters:
      bb -
      offset - Object's address
      index - object identifier
      Returns:
      the object
    • readDwgR2004SectionMap

      protected void readDwgR2004SectionMap(ByteBuffer bb)
      Reads the Section Map and fills the Sections Array with the sections found
      Parameters:
      bb -
    • readSystemSection

      protected ByteBuffer readSystemSection(ByteBuffer bb)
      Parameters:
      bb -
      Returns:
      Returns the decompressed data of SectionMap and Section Info.
    • readCompressedSection

      protected ByteBuffer readCompressedSection(ByteBuffer bb, int compressedSize, int decompressedSize, int checksum)
      Parameters:
      bb -
      compressedSize - size of the compressed data
      decompressedSize - size of the decompressed data
      checksum -
      Returns:
      the decompressed data of a compressed section.
    • readObjectHeader

      public int readObjectHeader(int[] data, int offset, DwgObject dwgObject) throws RuntimeException, CorruptedDwgEntityException
      Description copied from interface: IDwgFileReader
      Reads the header of a dwg object
      Specified by:
      readObjectHeader in interface IDwgFileReader
      Throws:
      RuntimeException
      CorruptedDwgEntityException
    • readObjectTailer

      public int readObjectTailer(int[] data, int offset, DwgObject dwgObject) throws RuntimeException, CorruptedDwgEntityException
      Description copied from interface: IDwgFileReader
      Reads the tailer of a dwg object.
      Specified by:
      readObjectTailer in interface IDwgFileReader
      Throws:
      RuntimeException
      CorruptedDwgEntityException