Package org.jaudiotagger.tag.datatype

Examples of org.jaudiotagger.tag.datatype.AbstractDataType


     * Object Iterator with data.
     *
     * @param copyObject
     */
    protected AbstractTagFrameBody(AbstractTagFrameBody copyObject) {
        AbstractDataType newObject;
        for (int i = 0; i < copyObject.objectList.size(); i++) {
            newObject = (AbstractDataType) ID3Tags.copyObject(copyObject.objectList.get(i));
            newObject.setBody(this);
            this.objectList.add(newObject);
        }
    }
View Full Code Here


     *
     * @param identifier <code>MP3Object</code> identifier
     * @param value      new datatype value
     */
    public final void setObjectValue(String identifier, Object value) {
        AbstractDataType object;
        Iterator<AbstractDataType> iterator = objectList.listIterator();
        while (iterator.hasNext()) {
            object = iterator.next();
            if (object.getIdentifier().equals(identifier)) {
                object.setValue(value);
            }
        }
    }
View Full Code Here

     * @param identifier
     * @return the datatype with the specified
     *         <code>identifier</code>
     */
    public final AbstractDataType getObject(String identifier) {
        AbstractDataType object;
        Iterator<AbstractDataType> iterator = objectList.listIterator();
        while (iterator.hasNext()) {
            object = iterator.next();
            if (object.getIdentifier().equals(identifier)) {
                return object;
            }
        }
        return null;
    }
View Full Code Here

     *
     * @return estimated size in bytes of this datatype
     */
    public int getSize() {
        int size = 0;
        AbstractDataType object;
        Iterator<AbstractDataType> iterator = objectList.listIterator();
        while (iterator.hasNext()) {
            object = iterator.next();
            size += object.getSize();
        }
        return size;
    }
View Full Code Here

        //Offset into buffer, incremented by length of previous MP3Object
        int offset = 0;

        //Go through the ObjectList of the Frame reading the data into the
        //correct datatype.
        AbstractDataType object;
        Iterator<AbstractDataType> iterator = objectList.listIterator();
        while (iterator.hasNext()) {
            //The read has extended further than the defined frame size
            if (offset > (size - 1)) {
                throw new InvalidTagException("Invalid size for Frame Body");
            }

            //Get next Object and load it with data from the Buffer
            object = iterator.next();
            object.readByteArray(buffer, offset);
            //Increment Offset to start of next datatype.
            offset += object.getSize();
        }
    }
View Full Code Here

     * @throws IOException on any I/O error
     */
    public void write(RandomAccessFile file) throws IOException {
        //Write the various fields to file in order
        byte[] buffer;
        AbstractDataType object;
        Iterator<AbstractDataType> iterator = objectList.listIterator();
        while (iterator.hasNext()) {
            object = iterator.next();
            buffer = object.writeByteArray();
            file.write(buffer);
        }
    }
View Full Code Here

     * Return the Text Encoding
     *
     * @return the text encoding used by this framebody
     */
    public final byte getTextEncoding() {
        AbstractDataType o = getObject(DataTypes.OBJ_TEXT_ENCODING);

        if (o != null) {
            Long encoding = (Long) (o.getValue());
            return encoding.byteValue();
        } else {
            return TextEncoding.ISO_8859_1;
        }
    }
View Full Code Here

TOP

Related Classes of org.jaudiotagger.tag.datatype.AbstractDataType

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.