@Override
	public IAISMessage decode(String decBytes) throws AISParseException {

		if (decBytes.length() < 301)
			throw new AISParseException(
					AISParseException.NOT_CONSISTENT_DECODED_STRING);
		/* Possition Reports Message ID 19 bits 0-5 */
		this.msgId = AISDecoder.getDecValueByBinStr(decBytes.substring(0, 6),
				false);
		logger.debug("messageId = " + msgId);

		/* User ID mmsi bits 8-37 */
		this.mmsi = AISDecoder.getDecValueByBinStr(decBytes.substring(8, 38),
				false);
		logger.debug("mmsi = " + mmsi);

		/* Speed over ground bits 46-55 - 10 bits */
		this.sog = AISDecoder.getDecValueByBinStr(decBytes.substring(46, 56),
				false) / 10.0;
		logger.debug("sog = " + Double.toString(sog));

		/* Longitude bits 57-84 */
		int longitudeHour = AISDecoder.getDecValueByBinStr(
				decBytes.substring(57, 85), true);
		this.longitude = longitudeHour / 600000.0;
		logger.debug("longitude = " + longitude);

		if (this.longitude > 180.0 || this.longitude < -180.0)
			throw new AISParseException(
					AISParseException.LONGITUDE_OUT_OF_RANGE + " " + longitude);

		/* Latitude bits 85-111 */
		int latitudeHour = AISDecoder.getDecValueByBinStr(
				decBytes.substring(85, 112), true);
		this.latitude = latitudeHour / 600000.0;
		logger.debug("latitude = " + latitude);

		if (this.latitude > 90.0 || this.latitude < -90.0)
			throw new AISParseException(AISParseException.LATITUDE_OUT_OF_RANGE
					+ " " + latitude);

		/* COG bits 112-123 */
		this.cog = AISDecoder.getDecValueByBinStr(decBytes.substring(112, 124),
				false) / 10.0;
		logger.debug("cog = " + cog);

		/* true heading bits 124-132 */
		this.trueHeading = AISDecoder.getDecValueByBinStr(
				decBytes.substring(124, 133), false);
		logger.debug("true heading = " + trueHeading);

		/* Name bits 143-262 - 120 bits */
		this.name = AISDecoder.getDecStringFrom6BitStr(decBytes.substring(143,
				263));
		logger.debug("name = " + name);

		// Type of ship and cargo type bits 263-270 - 8 bits

		this.shipType = AISDecoder.getDecValueByBinStr(
				decBytes.substring(263, 271), false);
		logger.debug("shipType = " + shipType);

		String mmsiStr = Integer.toString(this.mmsi);
		if (!(mmsiStr.length() < 3)) {
			this.countryId = Integer.valueOf(mmsiStr.substring(0, 3));
		} else {
			this.countryId = 0;
		}
		logger.debug("countryId = " + countryId);

		/* Dimension/reference for position bits 271-300 - 30 bits */
		this.dimensionA = AISDecoder.getDecValueByBinStr(
				decBytes.substring(271, 280), false);
		this.dimensionB = AISDecoder.getDecValueByBinStr(
				decBytes.substring(280, 289), false);
		this.dimensionC = AISDecoder.getDecValueByBinStr(
				decBytes.substring(289, 295), false);
		this.dimensionD = AISDecoder.getDecValueByBinStr(
				decBytes.substring(295, 301), false);
		logger.debug(dimensionA + " " + dimensionB + " " + dimensionC + " "
				+ dimensionD);

		int length = dimensionA + dimensionB;
		int width = dimensionC + dimensionD;
		logger.debug("length = " + length + "; width = " + width);

		// TODO: impelemt the rest bits
		// TODO: implement vesselType, cargoType, countryId, msgSrc

		Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
		this.msgTimestamp = new Timestamp(cal.getTimeInMillis());

		return this;
	}