public void readDwgBlockHeaderV15(int[] data, int offset) throws Exception {
		int bitPos = offset;
		Vector v = DwgUtil.getBitLong(data, bitPos);
		bitPos = ((Integer)v.get(0)).intValue();
		int numReactors = ((Integer)v.get(1)).intValue();
		setNumReactors(numReactors);
		v = DwgUtil.getTextString(data, bitPos);
		bitPos = ((Integer)v.get(0)).intValue();
		String name = (String)v.get(1);
		this.name = name;
		v = DwgUtil.testBit(data, bitPos);
		bitPos = ((Integer)v.get(0)).intValue();
		boolean flag = ((Boolean)v.get(1)).booleanValue();
		flag64 = flag;
		v = DwgUtil.getBitShort(data, bitPos);
		bitPos = ((Integer)v.get(0)).intValue();
		int xrefplus1 = ((Integer)v.get(1)).intValue();
		xRefPlus = xrefplus1;
		v = DwgUtil.testBit(data, bitPos);
		bitPos = ((Integer)v.get(0)).intValue();
		boolean xdep = ((Boolean)v.get(1)).booleanValue();
		this.xdep = xdep;
		v = DwgUtil.testBit(data, bitPos);
		bitPos = ((Integer)v.get(0)).intValue();
		boolean anon = ((Boolean)v.get(1)).booleanValue();
		anonymous = anon;
		v = DwgUtil.testBit(data, bitPos);
		bitPos = ((Integer)v.get(0)).intValue();
		boolean hasatts = ((Boolean)v.get(1)).booleanValue();
		hasAttrs = hasatts;
		v = DwgUtil.testBit(data, bitPos);
		bitPos = ((Integer)v.get(0)).intValue();
		boolean bxref = ((Boolean)v.get(1)).booleanValue();
		blkIsXRef = bxref;
		v = DwgUtil.testBit(data, bitPos);
		bitPos = ((Integer)v.get(0)).intValue();
		boolean xover = ((Boolean)v.get(1)).booleanValue();
		xRefOverLaid = xover;
		v = DwgUtil.testBit(data, bitPos);
		bitPos = ((Integer)v.get(0)).intValue();
		boolean loaded = ((Boolean)v.get(1)).booleanValue();
		this.loaded = loaded;
		v = DwgUtil.getBitDouble(data, bitPos);
		bitPos = ((Integer)v.get(0)).intValue();
		double bx = ((Double)v.get(1)).doubleValue();
		v = DwgUtil.getBitDouble(data, bitPos);
		bitPos = ((Integer)v.get(0)).intValue();
		double by = ((Double)v.get(1)).doubleValue();
		v = DwgUtil.getBitDouble(data, bitPos);
		bitPos = ((Integer)v.get(0)).intValue();
		double bz = ((Double)v.get(1)).doubleValue();
		double[] coord = new double[]{bx, by, bz};
		basePoint = coord;
		v = DwgUtil.getTextString(data, bitPos);
		bitPos = ((Integer)v.get(0)).intValue();
		String pname = (String)v.get(1);
		xRefPName = pname;
		int icount = 0;
		while (true) {
			v = DwgUtil.getRawChar(data, bitPos);
			bitPos = ((Integer)v.get(0)).intValue();
			int val = ((Integer)v.get(1)).intValue();
			if (val==0) {
				break;
			}
			icount++;
		}
		v = DwgUtil.getTextString(data, bitPos);
		bitPos = ((Integer)v.get(0)).intValue();
		String desc = (String)v.get(1);
		blockDescription = desc;
		v = DwgUtil.getBitLong(data, bitPos);
		bitPos = ((Integer)v.get(0)).intValue();
		int pdsize = ((Integer)v.get(1)).intValue();
		if (pdsize>0) {
			int count = pdsize + icount;
			//int pdata = ((Integer)DwgUtil.getBits(data, count, bitPos)).intValue();
			//previewData = pdata;
			bitPos = bitPos + count;
		}
		v = DwgUtil.getHandle(data, bitPos);
		bitPos = ((Integer)v.get(0)).intValue();
		int[] handle = new int[v.size()-1];
	    for (int j=1;j<v.size();j++) {
		    handle[j-1] = ((Integer)v.get(j)).intValue();
	    }
	    Vector handleVect = new Vector();
	    for (int i=0;i<handle.length;i++) {
	    	handleVect.add(new Integer(handle[i]));
	    }
	    blockControlHandle = DwgUtil.handleBinToHandleInt(handleVect);
		for (int i=0;i<numReactors;i++) {
			v = DwgUtil.getHandle(data, bitPos);
			bitPos = ((Integer)v.get(0)).intValue();
			handle = new int[v.size()-1];
		    for (int j=1;j<v.size();j++) {
			    handle[j-1] = ((Integer)v.get(j)).intValue();
		    }
		}
		v = DwgUtil.getHandle(data, bitPos);
		bitPos = ((Integer)v.get(0)).intValue();
		handle = new int[v.size()-1];
	    for (int j=1;j<v.size();j++) {
		    handle[j-1] = ((Integer)v.get(j)).intValue();
	    }
		v = DwgUtil.getHandle(data, bitPos);
		bitPos = ((Integer)v.get(0)).intValue();
		handle = new int[v.size()-1];
	    for (int j=1;j<v.size();j++) {
		    handle[j-1] = ((Integer)v.get(j)).intValue();
	    }
	    handleVect = new Vector();
	    for (int i=0;i<handle.length;i++) {
	    	handleVect.add(new Integer(handle[i]));
	    }
	    nullHandle = DwgUtil.handleBinToHandleInt(handleVect);
		v = DwgUtil.getHandle(data, bitPos);
		bitPos = ((Integer)v.get(0)).intValue();
		handle = new int[v.size()-1];
	    for (int j=1;j<v.size();j++) {
		    handle[j-1] = ((Integer)v.get(j)).intValue();
	    }
	    handleVect = new Vector();
	    for (int i=0;i<handle.length;i++) {
	    	handleVect.add(new Integer(handle[i]));
	    }
	    blockEntityHandle = DwgUtil.handleBinToHandleInt(handleVect);
		if ((!bxref) && (!xover)) {
			v = DwgUtil.getHandle(data, bitPos);
			bitPos = ((Integer)v.get(0)).intValue();
			handle = new int[v.size()-1];
		    for (int j=1;j<v.size();j++) {
			    handle[j-1] = ((Integer)v.get(j)).intValue();
		    }
		    handleVect = new Vector();
		    for (int i=0;i<handle.length;i++) {
		    	handleVect.add(new Integer(handle[i]));
		    }
		    firstEntityHandle = DwgUtil.handleBinToHandleInt(handleVect);
			v = DwgUtil.getHandle(data, bitPos);
			bitPos = ((Integer)v.get(0)).intValue();
			handle = new int[v.size()-1];
		    for (int j=1;j<v.size();j++) {
			    handle[j-1] = ((Integer)v.get(j)).intValue();
		    }
		    handleVect = new Vector();
		    for (int i=0;i<handle.length;i++) {
		    	handleVect.add(new Integer(handle[i]));
		    }
		    lastEntityHandle = DwgUtil.handleBinToHandleInt(handleVect);
		}
		v = DwgUtil.getHandle(data, bitPos);
		bitPos = ((Integer)v.get(0)).intValue();
		handle = new int[v.size()-1];
	    for (int j=1;j<v.size();j++) {
		    handle[j-1] = ((Integer)v.get(j)).intValue();
	    }
	    handleVect = new Vector();
	    for (int i=0;i<handle.length;i++) {
	    	handleVect.add(new Integer(handle[i]));
	    }
	    endBlkEntityHandle = DwgUtil.handleBinToHandleInt(handleVect);
		if (icount>0) {
			Vector handles = new Vector();
			for (int i=0;i<icount;i++) {
				v = DwgUtil.getHandle(data, bitPos);
				bitPos = ((Integer)v.get(0)).intValue();
				handle = new int[v.size()-1];
			    for (int j=1;j<v.size();j++) {
				    handle[j-1] = ((Integer)v.get(j)).intValue();
			    }
				handles.add(handle);
			}
		    insertHandles = handles;
		}
		v = DwgUtil.getHandle(data, bitPos);
		bitPos = ((Integer)v.get(0)).intValue();
		handle = new int[v.size()-1];
	    for (int j=1;j<v.size();j++) {
		    handle[j-1] = ((Integer)v.get(j)).intValue();
	    }
	    handleVect = new Vector();
	    for (int i=0;i<handle.length;i++) {
	    	handleVect.add(new Integer(handle[i]));
	    }
	    layoutHandle = DwgUtil.handleBinToHandleInt(handleVect);
	}
public void readDwgBlockHeaderV15 ( int [ ] data , int offset ) throws Exception { int bitPos = offset ; Vector v = DwgUtil . getBitLong ( data , bitPos ) ; bitPos = ( ( Integer ) v . get ( 0 ) ) . intValue ( ) ; int numReactors = ( ( Integer ) v . get ( 1 ) ) . intValue ( ) ; setNumReactors ( numReactors ) ; v = DwgUtil . getTextString ( data , bitPos ) ; bitPos = ( ( Integer ) v . get ( 0 ) ) . intValue ( ) ; String name = ( String ) v . get ( 1 ) ; this . name = name ; v = DwgUtil . testBit ( data , bitPos ) ; bitPos = ( ( Integer ) v . get ( 0 ) ) . intValue ( ) ; boolean flag = ( ( Boolean ) v . get ( 1 ) ) . booleanValue ( ) ; flag64 = flag ; v = DwgUtil . getBitShort ( data , bitPos ) ; bitPos = ( ( Integer ) v . get ( 0 ) ) . intValue ( ) ; int xrefplus1 = ( ( Integer ) v . get ( 1 ) ) . intValue ( ) ; xRefPlus = xrefplus1 ; v = DwgUtil . testBit ( data , bitPos ) ; bitPos = ( ( Integer ) v . get ( 0 ) ) . intValue ( ) ; boolean xdep = ( ( Boolean ) v . get ( 1 ) ) . booleanValue ( ) ; this . xdep = xdep ; v = DwgUtil . testBit ( data , bitPos ) ; bitPos = ( ( Integer ) v . get ( 0 ) ) . intValue ( ) ; boolean anon = ( ( Boolean ) v . get ( 1 ) ) . booleanValue ( ) ; anonymous = anon ; v = DwgUtil . testBit ( data , bitPos ) ; bitPos = ( ( Integer ) v . get ( 0 ) ) . intValue ( ) ; boolean hasatts = ( ( Boolean ) v . get ( 1 ) ) . booleanValue ( ) ; hasAttrs = hasatts ; v = DwgUtil . testBit ( data , bitPos ) ; bitPos = ( ( Integer ) v . get ( 0 ) ) . intValue ( ) ; boolean bxref = ( ( Boolean ) v . get ( 1 ) ) . booleanValue ( ) ; blkIsXRef = bxref ; v = DwgUtil . testBit ( data , bitPos ) ; bitPos = ( ( Integer ) v . get ( 0 ) ) . intValue ( ) ; boolean xover = ( ( Boolean ) v . get ( 1 ) ) . booleanValue ( ) ; xRefOverLaid = xover ; v = DwgUtil . testBit ( data , bitPos ) ; bitPos = ( ( Integer ) v . get ( 0 ) ) . intValue ( ) ; boolean loaded = ( ( Boolean ) v . get ( 1 ) ) . booleanValue ( ) ; this . loaded = loaded ; v = DwgUtil . getBitDouble ( data , bitPos ) ; bitPos = ( ( Integer ) v . get ( 0 ) ) . intValue ( ) ; double bx = ( ( Double ) v . get ( 1 ) ) . doubleValue ( ) ; v = DwgUtil . getBitDouble ( data , bitPos ) ; bitPos = ( ( Integer ) v . get ( 0 ) ) . intValue ( ) ; double by = ( ( Double ) v . get ( 1 ) ) . doubleValue ( ) ; v = DwgUtil . getBitDouble ( data , bitPos ) ; bitPos = ( ( Integer ) v . get ( 0 ) ) . intValue ( ) ; double bz = ( ( Double ) v . get ( 1 ) ) . doubleValue ( ) ; double [ ] coord = new double [ ] { bx , by , bz } ; basePoint = coord ; v = DwgUtil . getTextString ( data , bitPos ) ; bitPos = ( ( Integer ) v . get ( 0 ) ) . intValue ( ) ; String pname = ( String ) v . get ( 1 ) ; xRefPName = pname ; int icount = 0 ; while ( true ) { v = DwgUtil . getRawChar ( data , bitPos ) ; bitPos = ( ( Integer ) v . get ( 0 ) ) . intValue ( ) ; int val = ( ( Integer ) v . get ( 1 ) ) . intValue ( ) ; if ( val == 0 ) { break ; } icount ++ ; } v = DwgUtil . getTextString ( data , bitPos ) ; bitPos = ( ( Integer ) v . get ( 0 ) ) . intValue ( ) ; String desc = ( String ) v . get ( 1 ) ; blockDescription = desc ; v = DwgUtil . getBitLong ( data , bitPos ) ; bitPos = ( ( Integer ) v . get ( 0 ) ) . intValue ( ) ; int pdsize = ( ( Integer ) v . get ( 1 ) ) . intValue ( ) ; if ( pdsize > 0 ) { int count = pdsize + icount ; bitPos = bitPos + count ; } v = DwgUtil . getHandle ( data , bitPos ) ; bitPos = ( ( Integer ) v . get ( 0 ) ) . intValue ( ) ; int [ ] handle = new int [ v . size ( ) - 1 ] ; for ( int j = 1 ; j < v . size ( ) ; j ++ ) { handle [ j - 1 ] = ( ( Integer ) v . get ( j ) ) . intValue ( ) ; } Vector handleVect = new Vector ( ) ; for ( int i = 0 ; i < handle . length ; i ++ ) { handleVect . add ( new Integer ( handle [ i ] ) ) ; } blockControlHandle = DwgUtil . handleBinToHandleInt ( handleVect ) ; for ( int i = 0 ; i < numReactors ; i ++ ) { v = DwgUtil . getHandle ( data , bitPos ) ; bitPos = ( ( Integer ) v . get ( 0 ) ) . intValue ( ) ; handle = new int [ v . size ( ) - 1 ] ; for ( int j = 1 ; j < v . size ( ) ; j ++ ) { handle [ j - 1 ] = ( ( Integer ) v . get ( j ) ) . intValue ( ) ; } } v = DwgUtil . getHandle ( data , bitPos ) ; bitPos = ( ( Integer ) v . get ( 0 ) ) . intValue ( ) ; handle = new int [ v . size ( ) - 1 ] ; for ( int j = 1 ; j < v . size ( ) ; j ++ ) { handle [ j - 1 ] = ( ( Integer ) v . get ( j ) ) . intValue ( ) ; } v = DwgUtil . getHandle ( data , bitPos ) ; bitPos = ( ( Integer ) v . get ( 0 ) ) . intValue ( ) ; handle = new int [ v . size ( ) - 1 ] ; for ( int j = 1 ; j < v . size ( ) ; j ++ ) { handle [ j - 1 ] = ( ( Integer ) v . get ( j ) ) . intValue ( ) ; } handleVect = new Vector ( ) ; for ( int i = 0 ; i < handle . length ; i ++ ) { handleVect . add ( new Integer ( handle [ i ] ) ) ; } nullHandle = DwgUtil . handleBinToHandleInt ( handleVect ) ; v = DwgUtil . getHandle ( data , bitPos ) ; bitPos = ( ( Integer ) v . get ( 0 ) ) . intValue ( ) ; handle = new int [ v . size ( ) - 1 ] ; for ( int j = 1 ; j < v . size ( ) ; j ++ ) { handle [ j - 1 ] = ( ( Integer ) v . get ( j ) ) . intValue ( ) ; } handleVect = new Vector ( ) ; for ( int i = 0 ; i < handle . length ; i ++ ) { handleVect . add ( new Integer ( handle [ i ] ) ) ; } blockEntityHandle = DwgUtil . handleBinToHandleInt ( handleVect ) ; if ( ( ! bxref ) && ( ! xover ) ) { v = DwgUtil . getHandle ( data , bitPos ) ; bitPos = ( ( Integer ) v . get ( 0 ) ) . intValue ( ) ; handle = new int [ v . size ( ) - 1 ] ; for ( int j = 1 ; j < v . size ( ) ; j ++ ) { handle [ j - 1 ] = ( ( Integer ) v . get ( j ) ) . intValue ( ) ; } handleVect = new Vector ( ) ; for ( int i = 0 ; i < handle . length ; i ++ ) { handleVect . add ( new Integer ( handle [ i ] ) ) ; } firstEntityHandle = DwgUtil . handleBinToHandleInt ( handleVect ) ; v = DwgUtil . getHandle ( data , bitPos ) ; bitPos = ( ( Integer ) v . get ( 0 ) ) . intValue ( ) ; handle = new int [ v . size ( ) - 1 ] ; for ( int j = 1 ; j < v . size ( ) ; j ++ ) { handle [ j - 1 ] = ( ( Integer ) v . get ( j ) ) . intValue ( ) ; } handleVect = new Vector ( ) ; for ( int i = 0 ; i < handle . length ; i ++ ) { handleVect . add ( new Integer ( handle [ i ] ) ) ; } lastEntityHandle = DwgUtil . handleBinToHandleInt ( handleVect ) ; } v = DwgUtil . getHandle ( data , bitPos ) ; bitPos = ( ( Integer ) v . get ( 0 ) ) . intValue ( ) ; handle = new int [ v . size ( ) - 1 ] ; for ( int j = 1 ; j < v . size ( ) ; j ++ ) { handle [ j - 1 ] = ( ( Integer ) v . get ( j ) ) . intValue ( ) ; } handleVect = new Vector ( ) ; for ( int i = 0 ; i < handle . length ; i ++ ) { handleVect . add ( new Integer ( handle [ i ] ) ) ; } endBlkEntityHandle = DwgUtil . handleBinToHandleInt ( handleVect ) ; if ( icount > 0 ) { Vector handles = new Vector ( ) ; for ( int i = 0 ; i < icount ; i ++ ) { v = DwgUtil . getHandle ( data , bitPos ) ; bitPos = ( ( Integer ) v . get ( 0 ) ) . intValue ( ) ; handle = new int [ v . size ( ) - 1 ] ; for ( int j = 1 ; j < v . size ( ) ; j ++ ) { handle [ j - 1 ] = ( ( Integer ) v . get ( j ) ) . intValue ( ) ; } handles . add ( handle ) ; } insertHandles = handles ; } v = DwgUtil . getHandle ( data , bitPos ) ; bitPos = ( ( Integer ) v . get ( 0 ) ) . intValue ( ) ; handle = new int [ v . size ( ) - 1 ] ; for ( int j = 1 ; j < v . size ( ) ; j ++ ) { handle [ j - 1 ] = ( ( Integer ) v . get ( j ) ) . intValue ( ) ; } handleVect = new Vector ( ) ; for ( int i = 0 ; i < handle . length ; i ++ ) { handleVect . add ( new Integer ( handle [ i ] ) ) ; } layoutHandle = DwgUtil . handleBinToHandleInt ( handleVect ) ; }
Read a Block header in the DWG format Version 15

@param data Array of unsigned bytes obtained from the DWG binary file
@param offset The current bit offset where the value begins
@throws Exception If an unexpected bit value is found in the DWG file. Occurs
when we are looking for LwPolylines.