/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package kommentarborttagare; import java.io.FileNotFoundException; import java.io.IOException; import java.io.RandomAccessFile; import java.util.logging.Level; import java.util.logging.Logger; /** * * @author Diana */ public class Up46 { public static void main(String[] args) { Up46 obj = new Up46(); obj.lasInfo("musik.mp3"); } private void lasInfo(String filnamn){ try { RandomAccessFile raf = new RandomAccessFile(filnamn,"r"); long l = raf.length(); long pos = l-128+3; raf.seek(pos); byte[] b = new byte[30]; raf.read(b); String titel = new String(b); System.out.println("Titel = "+titel); }catch (FileNotFoundException ex) { System.out.println("Filen hittades ej!"); } catch (IOException ex) { System.out.println("Läsproblem!"); } } }