public final class DwgUtil
extends java.lang.Object
Constructor and Description |
---|
DwgUtil() |
Modifier and Type | Method and Description |
---|---|
static int[] |
bytesToMachineBytes(byte[] data)
Convert bytes to machine value bytes
|
static java.util.ArrayList |
getBitDouble(int[] data,
int offset)
Read a double value from a group of unsigned bytes
|
static java.util.ArrayList |
getBitLong(int[] data,
int offset)
Read a long value from a group of unsigned bytes
|
static java.lang.Object |
getBits(int[] data,
int count,
int offset)
Returns a set of bits from a group of unsigned bytes
|
static java.util.ArrayList |
getBitShort(int[] data,
int offset)
Read a short value from a group of unsigned bytes
|
static java.util.ArrayList |
getCmColor(int[] intData,
int offset,
java.lang.String version)
Read a CmColor from a group of unsigned bytes
|
static java.util.ArrayList |
getDefaultDouble(int[] data,
int offset,
double defVal)
Read a double value from a group of unsigned bytes and a default double
|
static java.util.ArrayList |
getHandle(int[] data,
int offset)
Read a int value (the handle of a DWG object) from a group of unsigned
bytes
|
static java.util.ArrayList |
getModularChar(int[] data,
int offset)
Read a char value from a group of unsigned bytes
|
static int |
getModularShort(java.nio.ByteBuffer bb)
Read a int value (the size of a modular short) from a ByteBuffer
|
static java.util.ArrayList |
getRawChar(int[] data,
int offset)
Read a char value from a group of unsigned bytes
|
static java.util.ArrayList |
getRawDouble(int[] data,
int offset)
Read a double value from a group of unsigned bytes
|
static java.util.ArrayList |
getRawLong(int[] data,
int offset)
Read a long value from a group of unsigned bytes
|
static java.util.ArrayList |
getRawShort(int[] data,
int offset)
Read a short value from a group of unsigned bytes
|
static java.util.ArrayList |
getTextString(int[] data,
int offset)
Read a String from a group of unsigned bytes
|
static int |
handleBinToHandleInt(java.util.ArrayList layerHandle)
Obtain the int value of a handle given in binary format
|
static int |
handleToInt(java.util.List fromGetHandle)
It receives the list procedent from getHandle method, and return the
handle as int
|
static java.util.ArrayList |
readExtendedData(int[] data,
int offset)
Read the extended data for a DWG object
Don't use in this version.
|
static java.util.ArrayList |
testBit(int[] data,
int offset)
Test a bit obtained from a set of unsigned bytes
|
static int[] |
toIntArray(byte[] bytes) |
public static java.util.ArrayList readExtendedData(int[] data, int offset) throws java.lang.RuntimeException
data
- Array of unsigned bytes obtained from the DWG binary fileoffset
- The current bit offset where the value beginsjava.lang.RuntimeException
- If an unexpected bit value is found in the DWG file. Occurs
when we are looking for LwPolylines.public static java.util.ArrayList getDefaultDouble(int[] data, int offset, double defVal) throws java.lang.RuntimeException
data
- Array of unsigned bytes obtained from the DWG binary fileoffset
- The current bit offset where the value beginsdefVal
- Default double valuejava.lang.RuntimeException
- If an unexpected bit value is found in the DWG file. Occurs
when we are looking for LwPolylines.public static java.util.ArrayList getBitDouble(int[] data, int offset) throws java.lang.RuntimeException
data
- Array of unsigned bytes obtained from the DWG binary fileoffset
- The current bit offset where the value beginsjava.lang.RuntimeException
- If an unexpected bit value is found in the DWG file. Occurs
when we are looking for LwPolylines.public static java.util.ArrayList getRawDouble(int[] data, int offset) throws java.lang.RuntimeException
data
- Array of unsigned bytes obtained from the DWG binary fileoffset
- The current bit offset where the value beginsjava.lang.RuntimeException
- If an unexpected bit value is found in the DWG file. Occurs
when we are looking for LwPolylines.public static java.util.ArrayList getBitShort(int[] data, int offset) throws java.lang.RuntimeException
data
- Array of unsigned bytes obtained from the DWG binary fileoffset
- The current bit offset where the value beginsjava.lang.RuntimeException
- If an unexpected bit value is found in the DWG file. Occurs
when we are looking for LwPolylines.public static java.util.ArrayList getRawShort(int[] data, int offset) throws java.lang.RuntimeException
data
- Array of unsigned bytes obtained from the DWG binary fileoffset
- The current bit offset where the value beginsjava.lang.RuntimeException
- If an unexpected bit value is found in the DWG file. Occurs
when we are looking for LwPolylines.public static java.util.ArrayList getBitLong(int[] data, int offset) throws java.lang.RuntimeException
data
- Array of unsigned bytes obtained from the DWG binary fileoffset
- The current bit offset where the value beginsjava.lang.RuntimeException
- If an unexpected bit value is found in the DWG file. Occurs
when we are looking for LwPolylines.public static java.util.ArrayList getRawLong(int[] data, int offset) throws java.lang.RuntimeException
data
- Array of unsigned bytes obtained from the DWG binary fileoffset
- The current bit offset where the value beginsjava.lang.RuntimeException
- If an unexpected bit value is found in the DWG file. Occurs
when we are looking for LwPolylines.java.lang.RuntimeException
public static java.util.ArrayList getRawChar(int[] data, int offset) throws java.lang.RuntimeException
data
- Array of unsigned bytes obtained from the DWG binary fileoffset
- The current bit offset where the value beginsjava.lang.RuntimeException
- If an unexpected bit value is found in the DWG file. Occurs
when we are looking for LwPolylines.public static java.util.ArrayList getModularChar(int[] data, int offset) throws java.lang.RuntimeException
data
- Array of unsigned bytes obtained from the DWG binary fileoffset
- The current bit offset where the value beginsjava.lang.RuntimeException
- If an unexpected bit value is found in the DWG file. Occurs
when we are looking for LwPolylines.public static java.util.ArrayList getTextString(int[] data, int offset) throws java.lang.RuntimeException
data
- Array of unsigned bytes obtained from the DWG binary fileoffset
- The current bit offset where the value beginsjava.lang.RuntimeException
- If an unexpected bit value is found in the DWG file. Occurs
when we are looking for LwPolylines.public static java.util.ArrayList getCmColor(int[] intData, int offset, java.lang.String version) throws java.lang.RuntimeException
data
- Array of unsigned bytes obtained from the DWG binary fileoffset
- The current bit offset where the value beginsjava.lang.RuntimeException
- If an unexpected bit value is found in the DWG file. Occurs
when we are looking for LwPolylines.public static java.util.ArrayList getHandle(int[] data, int offset) throws java.lang.RuntimeException
data
- Array of unsigned bytes obtained from the DWG binary fileoffset
- The current bit offset where the value beginsjava.lang.RuntimeException
- If an unexpected bit value is found in the DWG file. Occurs
when we are looking for LwPolylines.public static int getModularShort(java.nio.ByteBuffer bb)
bb
- Data given as a ByteBufferpublic static java.lang.Object getBits(int[] data, int count, int offset) throws java.lang.RuntimeException
data
- Array of unsigned bytes obtained from the DWG binary filecount
- Bit counteroffset
- The current bit offset where the value beginsjava.lang.RuntimeException
- If an unexpected bit value is found in the DWG file. Occurs
when we are looking for LwPolylines.public static java.util.ArrayList testBit(int[] data, int offset)
data
- Array of unsigned bytes obtained from the DWG binary fileoffset
- The current bit offset where the value beginspublic static int[] bytesToMachineBytes(byte[] data)
data
- Input of array of bytespublic static int handleToInt(java.util.List fromGetHandle)
public static int handleBinToHandleInt(java.util.ArrayList layerHandle)
layerHandle
- Handle in binary formatpublic static int[] toIntArray(byte[] bytes)