public void decodeFromMessage(byte[] message) throws UnrecognizedMessageException {
byte first = message[0];
// Check if spare field consists of ones
if ((checkSpareBits)&&(((first >> 1) & 0x07) != 0x07)) throw new UnrecognizedMessageException("Message is not of type GTP' : Spare part is not '111'");
pt = (byte)((first >> 4) & 0x01);
if (pt != GtpPrime3gppConstants.GTP_PRIME_PROTOCOL_TYPE) throw new UnrecognizedMessageException("Message is not of type GTP' : ProtocolType field is not GTP'");
version = (byte)((first >> 5) & 0x07);
messageType = (short)convertByteToInt(message[1]);
this.length = (convertByteToInt(message[2]) << 8) + convertByteToInt(message[3]);