/** * Read the key from the buffer. * * @param arr * @param offset * @throws InvalidDataTypeException if emptyValues are not allowed and the eky was invalid. */ public void readByteArray(byte[] arr, int offset) throws InvalidDataTypeException { super.readByteArray(arr, offset); //Mismatch:Superclass uses Long, but maps expect Integer Integer intValue = ((Long) value).intValue(); if (!keyToValue.containsKey(intValue)) { if (!hasEmptyValue) { throw new InvalidDataTypeException(ErrorMessage.MP3_REFERENCE_KEY_INVALID.getMsg(identifier, intValue)); } else if (identifier.equals(DataTypes.OBJ_PICTURE_TYPE)) { //logger.warning(ErrorMessage.MP3_PICTURE_TYPE_INVALID.getMsg(value)); } } }
/** * Read the key from the buffer. * * @param arr * @param offset * @throws InvalidDataTypeException if emptyValues are not allowed and the eky was invalid. */ public void readByteArray(byte[] arr, int offset) throws InvalidDataTypeException { super.readByteArray(arr, offset); //Mismatch:Superclass uses Long, but maps expect Integer Integer intValue = ((Long) value).intValue(); if (!keyToValue.containsKey(intValue)) { if (!hasEmptyValue) { throw new InvalidDataTypeException(ErrorMessage.MP3_REFERENCE_KEY_INVALID.getMsg(identifier, intValue)); } else if (identifier.equals(DataTypes.OBJ_PICTURE_TYPE)) { logger.warning(ErrorMessage.MP3_PICTURE_TYPE_INVALID.getMsg(value)); } } }
/** * Read the key from the buffer. * * @param arr * @param offset * @throws InvalidDataTypeException if emptyValues are not allowed and the eky was invalid. */ public void readByteArray(byte[] arr, int offset) throws InvalidDataTypeException { super.readByteArray(arr, offset); //Mismatch:Superclass uses Long, but maps expect Integer Integer intValue = ((Long) value).intValue(); if (!keyToValue.containsKey(intValue)) { if (!hasEmptyValue) { throw new InvalidDataTypeException(ErrorMessage.MP3_REFERENCE_KEY_INVALID.getMsg(identifier, intValue)); } else if (identifier.equals(DataTypes.OBJ_PICTURE_TYPE)) { logger.warning(ErrorMessage.MP3_PICTURE_TYPE_INVALID.getMsg(value)); } } }
@Override public void readByteArray(final byte[] buffer, final int originalOffset) throws InvalidDataTypeException { int localOffset = originalOffset; int size = getSize(); logger.finest("offset:" + localOffset); //The read has extended further than the defined frame size (ok to extend upto //size because the next datatype may be of length 0.) if (originalOffset > buffer.length-size) { logger.warning("Invalid size for FrameBody"); throw new InvalidDataTypeException("Invalid size for FrameBody"); } this.tempo.readByteArray(buffer, localOffset); localOffset += this.tempo.getSize(); this.timestamp.readByteArray(buffer, localOffset); localOffset += this.timestamp.getSize(); }
@Override public void readByteArray(final byte[] buffer, final int originalOffset) throws InvalidDataTypeException { int localOffset = originalOffset; int size = getSize(); logger.finest("offset:" + localOffset); //The read has extended further than the defined frame size (ok to extend upto //size because the next datatype may be of length 0.) if (originalOffset > buffer.length-size) { logger.warning("Invalid size for FrameBody"); throw new InvalidDataTypeException("Invalid size for FrameBody"); } this.type.readByteArray(buffer, localOffset); localOffset += this.type.getSize(); this.timestamp.readByteArray(buffer, localOffset); localOffset += this.timestamp.getSize(); }