src/com/shrewdify/diaroser/utils/ElementParser.java
public void printPacket(byte[] b) throws NoSpaceException, IOException {
		int tmp;
		DataInputStream in = new DataInputStream(new ByteArrayInputStream(b));
		tmp = in.readInt();
		short version = (short) (tmp >> 24);
		if (version != 1) {
			throw new NoSpaceException("Illegal value of version " + version);
		}

		if (b.length != (tmp & 0x00FFFFFF)) {
			// throw new ParseException("Wrong length of data: " + (tmp &
			// 0x00FFFFFF));
			throw new NoSpaceException("Wrong length of data: " + (tmp & 0x00FFFFFF));
		}

		tmp = in.readInt();
		short flags = (short) ((tmp >> 24) & 0xFF);
		int commandCode = (int) (tmp & 0xFFFFFF);
		long applicationId = ((long) in.readInt() << 32) >>> 32;
		long hopByHopId = ((long) in.readInt() << 32) >>> 32;
		long endToEndId = ((long) in.readInt() << 32) >>> 32;

		log.debug("Version: " + version);
		log.debug("Flags: " + flags);
		log.debug("CommandCode: " + commandCode);
		log.debug("ApplicationId: " + applicationId);
		log.debug("HopByHopId: " + hopByHopId);
		log.debug("EndtoEndId: " + endToEndId);
		Hashtable<Integer, Avp> hs = decodeAvpSet(b, 20);
		for (Iterator<Avp> iterator = hs.values().iterator(); iterator
				.hasNext();) {
			Avp avp = iterator.next();
			log.debug(avp.toString());
		}

	}
/**
	 * 
	 * @param b
	 * @throws NoSpaceException
	 * @throws IOException
	 * 
	 * Decode the bytes and change them correspondingly to Strings and Print them
	 */


Decode the bytes and change them correspondingly to Strings and Print them
Decode the bytes and change them correspondingly to Strings and Print them
public void printPacket(byte[] b) throws NoSpaceException, IOException {
		int tmp;
		DataInputStream in = new DataInputStream(new ByteArrayInputStream(b));
		tmp = in.readInt();
		short version = (short) (tmp >> 24);
		if (version != 1) {
			throw new NoSpaceException("Illegal value of version " + version);
		}
		if (b.length != (tmp & 0x00FFFFFF)) {
			throw new NoSpaceException("Wrong length of data: " + (tmp & 0x00FFFFFF));
		}
		tmp = in.readInt();
		short flags = (short) ((tmp >> 24) & 0xFF);
		int commandCode = (int) (tmp & 0xFFFFFF);
		long applicationId = ((long) in.readInt() << 32) >>> 32;
		long hopByHopId = ((long) in.readInt() << 32) >>> 32;
		long endToEndId = ((long) in.readInt() << 32) >>> 32;
		log.debug("Version: " + version);
		log.debug("Flags: " + flags);
		log.debug("CommandCode: " + commandCode);
		log.debug("ApplicationId: " + applicationId);
		log.debug("HopByHopId: " + hopByHopId);
		log.debug("EndtoEndId: " + endToEndId);
		Hashtable<Integer, Avp> hs = decodeAvpSet(b, 20);
		for (Iterator<Avp> iterator = hs.values().iterator(); iterator
				.hasNext();) {
			Avp avp = iterator.next();
			log.debug(avp.toString());
		}
	}
public void printPacket ( byte [ ] b ) throws NoSpaceException , IOException { int tmp ; DataInputStream in = new DataInputStream ( new ByteArrayInputStream ( b ) ) ; tmp = in . readInt ( ) ; short version = ( short ) ( tmp >> 24 ) ; if ( version != 1 ) { throw new NoSpaceException ( "Illegal value of version " + version ) ; } if ( b . length != ( tmp & 0x00FFFFFF ) ) { throw new NoSpaceException ( "Wrong length of data: " + ( tmp & 0x00FFFFFF ) ) ; } tmp = in . readInt ( ) ; short flags = ( short ) ( ( tmp >> 24 ) & 0xFF ) ; int commandCode = ( int ) ( tmp & 0xFFFFFF ) ; long applicationId = ( ( long ) in . readInt ( ) << 32 ) >>> 32 ; long hopByHopId = ( ( long ) in . readInt ( ) << 32 ) >>> 32 ; long endToEndId = ( ( long ) in . readInt ( ) << 32 ) >>> 32 ; log . debug ( "Version: " + version ) ; log . debug ( "Flags: " + flags ) ; log . debug ( "CommandCode: " + commandCode ) ; log . debug ( "ApplicationId: " + applicationId ) ; log . debug ( "HopByHopId: " + hopByHopId ) ; log . debug ( "EndtoEndId: " + endToEndId ) ; Hashtable < Integer , Avp > hs = decodeAvpSet ( b , 20 ) ; for ( Iterator < Avp > iterator = hs . values ( ) . iterator ( ) ; iterator . hasNext ( ) ; ) { Avp avp = iterator . next ( ) ; log . debug ( avp . toString ( ) ) ; } }
@param b
 @throws NoSpaceException
 @throws IOException
@param b @throws NoSpaceException @throws IOException
// throw new ParseException("Wrong length of data: " + (tmp & // 0x00FFFFFF));