/** * 得到此对象的128个字节的表示形式 * @return */ public byte[] getBytes() { byte[] data = new byte[128]; System.arraycopy(TAG.getBytes(), 0, data, 0, 3); byte[] temp = songName.getBytes(); System.arraycopy(temp, 0, data, 3, temp.length > 30 ? 30 : temp.length); temp = artist.getBytes(); System.arraycopy(temp, 0, data, 33, temp.length > 30 ? 30 : temp.length); temp = album.getBytes(); System.arraycopy(temp, 0, data, 63, temp.length > 30 ? 30 : temp.length); temp = year.getBytes(); System.arraycopy(temp, 0, data, 93, temp.length > 4 ? 4 : temp.length); temp = comment.getBytes(); System.arraycopy(temp, 0, data, 97, temp.length > 28 ? 28 : temp.length); data[125] = r1; data[126] = r2; data[127] = r3; return data; }
(编辑:aniston)
|