code: public static byte[] extractASDU(byte[] apdu)
  	{
  		final int svc = getAPDUService(apdu);
  		int offset = 2;
  		int mask = 0xff;
  		// 0x40 A_GroupValue_Response-PDU
  		// 0x80 A_GroupValue_Write-PDU
  		if (svc == 0x40 || svc == 0x80) {
  			// only adjust for optimized read.res and write
  			if (apdu.length <= 2) {
  				offset = 1;
  				mask = 0x3f;
  			}
  		}
  		// 0x0180 A_ADC_Read-PDU
  		// 0x01C0 A_ADC_Response-PDU
  		else if (svc == 0x0180 || svc == 0x01C0) {
  			offset = 1;
  			mask = 0x3f;
  		}
  		// 0x0200 A_Memory_Read-PDU
  		// 0x0240 A_Memory_Response-PDU
  		// 0x0280 A_Memory_Write-PDU
  		else if (svc == 0x0200 || svc == 0x0240 || svc == 0x0280) {
  			offset = 1;
  			mask = 0x0f;
  		}
  		final byte[] asdu = new byte[apdu.length - offset];
  		for (int i = 0; i < asdu.length; ++i)
  			asdu[i] = apdu[offset + i];
  		asdu[0] &= mask;
  		return asdu;
  	}
docs: Returns a copy of the ASDU contained in the supplied APDU.
  <p>
  The application layer service data unit (ASDU) is the APDU with the application
  layer service code removed.
  
  @param apdu application layer protocol data unit for which to get the ASDU
  @return the ASDU as byte array