Salve, sono un programmatore visual basic ma, nella ricerca di esempi per un mio problema, ho trovato un sorgente java che penso di aver capito. L'unico mio dubbio è: gli array in java hanno base 0 o 1?
questo è il frammento di codice incriminato
codice:String sComment; boolean bHasTrackNum; int iTrackNum = -1; byte[] abyTemp = new byte[30]; if (oIS.read(abyTemp) != 30) { throw new ID3Exception("Unexpected EOF while reading omment."); } if ((abyTemp[28] == 0) && (abyTemp[29] != 0)) { // this is a v1.1 tag with comment and track number byte[] abyComment = new byte[29]; System.arraycopy(abyTemp, 0, abyComment, 0, 29); sComment = new String(abyComment, 0, indexOfFirstNull(abyComment)); iTrackNum = abyTemp[29] & 0xff; bHasTrackNum = true; } else { // this is just a comment sComment = new String(abyTemp, 0, indexOfFirstNull(abyTemp)); bHasTrackNum = false; }

Rispondi quotando