当前位置: 首页>>代码示例>>Java>>正文


Java Utils.getDefaultBytes方法代码示例

本文整理汇总了Java中org.jaudiotagger.audio.generic.Utils.getDefaultBytes方法的典型用法代码示例。如果您正苦于以下问题:Java Utils.getDefaultBytes方法的具体用法?Java Utils.getDefaultBytes怎么用?Java Utils.getDefaultBytes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.jaudiotagger.audio.generic.Utils的用法示例。


在下文中一共展示了Utils.getDefaultBytes方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createMetadataBlockDataPicture

import org.jaudiotagger.audio.generic.Utils; //导入方法依赖的package包/类
/**
 * Create MetadataBlockPicture field, this is the preferred way of storing artwork in VorbisComment tag now but
 * has to be base encoded to be stored in VorbisComment
 *
 * @return MetadataBlockDataPicture
 */
private MetadataBlockDataPicture createMetadataBlockDataPicture(Artwork artwork) throws FieldDataInvalidException {
    if (artwork.isLinked()) {
        return new MetadataBlockDataPicture(
                Utils.getDefaultBytes(artwork.getImageUrl(), TextEncoding.CHARSET_ISO_8859_1),
                artwork.getPictureType(),
                MetadataBlockDataPicture.IMAGE_IS_URL,
                "",
                0,
                0,
                0,
                0);
    } else {
        if (!artwork.setImageFromData()) {
            throw new FieldDataInvalidException("Unable to create MetadataBlockDataPicture from buffered");
        }
        return new MetadataBlockDataPicture(artwork.getBinaryData(),
                artwork.getPictureType(),
                artwork.getMimeType(),
                artwork.getDescription(),
                artwork.getWidth(),
                artwork.getHeight(),
                0,
                0);
    }
}
 
开发者ID:openaudible,项目名称:openaudible,代码行数:32,代码来源:VorbisCommentTag.java

示例2: createField

import org.jaudiotagger.audio.generic.Utils; //导入方法依赖的package包/类
/**
 * Create artwork field
 *
 * @return
 */
public TagField createField(Artwork artwork) throws FieldDataInvalidException {
    if (artwork.isLinked()) {
        return new MetadataBlockDataPicture(
                Utils.getDefaultBytes(artwork.getImageUrl(), TextEncoding.CHARSET_ISO_8859_1),
                artwork.getPictureType(),
                MetadataBlockDataPicture.IMAGE_IS_URL,
                "",
                0,
                0,
                0,
                0);
    } else {
        if (!artwork.setImageFromData()) {
            throw new FieldDataInvalidException("Unable to createField buffered image from the image");
        }

        return new MetadataBlockDataPicture(artwork.getBinaryData(),
                artwork.getPictureType(),
                artwork.getMimeType(),
                artwork.getDescription(),
                artwork.getWidth(),
                artwork.getHeight(),
                0,
                0);
    }
}
 
开发者ID:openaudible,项目名称:openaudible,代码行数:32,代码来源:FlacTag.java

示例3: writeByteArray

import org.jaudiotagger.audio.generic.Utils; //导入方法依赖的package包/类
public byte[] writeByteArray() {
    return Utils.getDefaultBytes(writeString(), "ISO8859-1");
}
 
开发者ID:openaudible,项目名称:openaudible,代码行数:4,代码来源:Lyrics3TimeStamp.java

示例4: writeByteArray

import org.jaudiotagger.audio.generic.Utils; //导入方法依赖的package包/类
public byte[] writeByteArray() {
    return Utils.getDefaultBytes(writeString(), "ISO-8859-1");
}
 
开发者ID:openaudible,项目名称:openaudible,代码行数:4,代码来源:Lyrics3Image.java

示例5: getIdBytes

import org.jaudiotagger.audio.generic.Utils; //导入方法依赖的package包/类
/**
 * @return field identifier as it will be held within the file
 */
protected byte[] getIdBytes() {
    return Utils.getDefaultBytes(getId(), "ISO-8859-1");
}
 
开发者ID:openaudible,项目名称:openaudible,代码行数:7,代码来源:Mp4TagField.java

示例6: createLinkedArtworkField

import org.jaudiotagger.audio.generic.Utils; //导入方法依赖的package包/类
/**
 * Create Link to Image File, not recommended because if either flac or image file is moved link
 * will be broken.
 *
 * @param url
 * @return
 */
public TagField createLinkedArtworkField(String url) {
    //Add to image list
    return new MetadataBlockDataPicture(Utils.getDefaultBytes(url, TextEncoding.CHARSET_ISO_8859_1), PictureTypes.DEFAULT_ID, MetadataBlockDataPicture.IMAGE_IS_URL, "", 0, 0, 0, 0);
}
 
开发者ID:openaudible,项目名称:openaudible,代码行数:12,代码来源:FlacTag.java

示例7: getRawContent

import org.jaudiotagger.audio.generic.Utils; //导入方法依赖的package包/类
/**
 * (overridden)
 *
 * @see org.jaudiotagger.tag.TagField#getRawContent()
 */
public byte[] getRawContent() {
    return this.content == null ? new byte[]{} : Utils.getDefaultBytes(this.content, getEncoding());
}
 
开发者ID:openaudible,项目名称:openaudible,代码行数:9,代码来源:AiffTag.java


注:本文中的org.jaudiotagger.audio.generic.Utils.getDefaultBytes方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。