java高手进来帮我给段代码 写下注释.

来源:百度知道 编辑:UC知道 时间:2024/06/08 15:02:54
这时一个读取mp3相关信息的代码:
package core;

import java.io.File;
import java.io.IOException;
import java.io.RandomAccessFile;

public class MP3InfoReader {
//
// 名称 *******位置**** 长度**** 内容
// Header *****1-3 **** 3 **** 标签头
// Title *******4-33 ****30 **** 标题
// Artist ******34-63 **** 30 **** 艺术家
// Album ******64-93 **** 30 **** 专辑
// Year *******94-97 **** 4 **** 出品年代
// Comment ****98-127 ****30 **** 备注
// Cenre ******128 **** 1 **** 类型
//
private static final int TAG_SIZE = 128;
private static final int TITLE_SIZE = 30;
private static final int ARTIST_SIZE = 30;
private static final String TAG_START = "TAG";

public static String handleID3v1(File file) throws IOException {
byte[] buf = new byte[TAG_SIZE];

RandomAccessFile randomAccessFile = new RandomAccessFile(file, "r");
randomAccessFile.seek(randomAccessFile.length

这时一个读取mp3相关信息的代码:
package core; //声明 包

import java.io.File; //导入类包
import java.io.IOException;
import java.io.RandomAccessFile;

public class MP3InfoReader { //定义类
//
// 名称 *******位置**** 长度**** 内容 这些都是MP3文件说明信息
// Header *****1-3 **** 3 **** 标签头
// Title *******4-33 ****30 **** 标题
// Artist ******34-63 **** 30 **** 艺术家
// Album ******64-93 **** 30 **** 专辑
// Year *******94-97 **** 4 **** 出品年代
// Comment ****98-127 ****30 **** 备注
// Cenre ******128 **** 1 **** 类型
//
private static final int TAG_SIZE = 128; 定义常量值
private static final int TITLE_SIZE = 30;
private static final int ARTIST_SIZE = 30;
private static final String TAG_START = "TAG";
//定义静态方法,他需要传进一个FILE类型参数,方法向上抛出IO异常
public static String handleID3v1(File file) throws IOException {
byte[] buf = new byte[TAG_SIZE]; //定义一个长度为128的字节数组

RandomAccessFile randomAccessFile =