Package org.gvsig.dwg.lib.readers
Class DwgFileVR2004Reader
java.lang.Object
org.gvsig.dwg.lib.readers.DwgFileVR2004Reader
- All Implemented Interfaces:
IDwgFileReader
- Author:
- alzabord TODO To change the template for this generated type comment go to Window - Preferences - Java - Code Style - Code Templates
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidread(DwgFile dwgFile, ByteBuffer bb) Reads the DWG version 2004 formatprotected ByteBufferreadCompressedSection(ByteBuffer bb, int compressedSize, int decompressedSize, int checksum) protected voidThis function reads the header section of the file, with the encrypted dataprotected voidprotected DwgObjectreadDwgR2004Object(ByteBuffer bb, int offset, int index) Read commun parameters for an Objectprotected voidReads all the object referenced in the object map section of the DWG file (using their object file obsets)protected voidReads the Section Map and fills the Sections Array with the sections foundintreadObjectHeader(int[] data, int offset, DwgObject dwgObject) Reads the header of a dwg objectintreadObjectTailer(int[] data, int offset, DwgObject dwgObject) Reads the tailer of a dwg object.protected ByteBufferreadSection(ByteBuffer bb, String name) protected ByteBuffer
-
Field Details
-
dwgFile
-
bb
-
-
Constructor Details
-
DwgFileVR2004Reader
public DwgFileVR2004Reader()
-
-
Method Details
-
read
Reads the DWG version 2004 format- Specified by:
readin interfaceIDwgFileReader- Parameters:
dwgFile- Represents the DWG file that we want to readbb- Memory mapped byte buffer of the whole DWG file- Throws:
IOException- When DWG file path is wrong
-
readDwgR2004InfoSection
-
readDwgR2004FileHeader
This function reads the header section of the file, with the encrypted data- Parameters:
bb- ByteBuffer containing the opened DWG file
-
readSection
- 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
Read commun parameters for an Object- Parameters:
bb-offset- Object's addressindex- object identifier- Returns:
- the object
-
readDwgR2004SectionMap
Reads the Section Map and fills the Sections Array with the sections found- Parameters:
bb-
-
readSystemSection
- 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 datadecompressedSize- size of the decompressed datachecksum-- 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:IDwgFileReaderReads the header of a dwg object- Specified by:
readObjectHeaderin interfaceIDwgFileReader- Throws:
RuntimeExceptionCorruptedDwgEntityException
-
readObjectTailer
public int readObjectTailer(int[] data, int offset, DwgObject dwgObject) throws RuntimeException, CorruptedDwgEntityException Description copied from interface:IDwgFileReaderReads the tailer of a dwg object.- Specified by:
readObjectTailerin interfaceIDwgFileReader- Throws:
RuntimeExceptionCorruptedDwgEntityException
-