Mp3Song - song.seek((song.length() - 128)); s byte a = new...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
package lab08; p import java.io.IOException; import java.io.RandomAccessFile; i public class Mp3Song { p public static void main(String[] args) throws IOException { p RandomAccessFile song = new RandomAccessFile("C:\\Users\\Aldin's Laptop W7\\Desktop\\Coms 227 Files\\song.mp3", "r"); //DataInputStream song = new DataInputStream(new FileInputStream("C:\\Users\\ Aldin's Laptop W7\\Desktop\\Coms 227 Files\\song.mp3"));
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: song.seek((song.length() - 128)); s byte a = new byte[128]; b for(int i = 0; i < 128; i++){ a[i] = song.readByte(); } String b = new String(a); System.out.println(b.substring(0, 3)); System.out.println(b.substring(3, 33)); System.out.println(b.substring(33, 63)); System.out.println(b.substring(63, 67)); System.out.println(b.substring(67, 100)); System.out.println(a[127]); S }}...
View Full Document

Ask a homework question - tutors are online