Package davaguine.jmac.tools

Examples of davaguine.jmac.tools.ByteArrayReader.readString()


        try {
            final ID3Tag tag = new ID3Tag();
            final ByteArrayReader reader = new ByteArrayReader(file, ID3_TAG_BYTES);
            tag.Header = reader.readString(3, defaultEncoding);
            tag.Title = reader.readString(30, defaultEncoding);
            tag.Artist = reader.readString(30, defaultEncoding);
            tag.Album = reader.readString(30, defaultEncoding);
            tag.Year = reader.readString(4, defaultEncoding);
            tag.Comment = reader.readString(29, defaultEncoding);
            tag.Track = reader.readUnsignedByte();
            tag.Genre = reader.readUnsignedByte();
View Full Code Here


            final ID3Tag tag = new ID3Tag();
            final ByteArrayReader reader = new ByteArrayReader(file, ID3_TAG_BYTES);
            tag.Header = reader.readString(3, defaultEncoding);
            tag.Title = reader.readString(30, defaultEncoding);
            tag.Artist = reader.readString(30, defaultEncoding);
            tag.Album = reader.readString(30, defaultEncoding);
            tag.Year = reader.readString(4, defaultEncoding);
            tag.Comment = reader.readString(29, defaultEncoding);
            tag.Track = reader.readUnsignedByte();
            tag.Genre = reader.readUnsignedByte();
            return tag.Header.equals("TAG") ? tag : null;
View Full Code Here

            final ByteArrayReader reader = new ByteArrayReader(file, ID3_TAG_BYTES);
            tag.Header = reader.readString(3, defaultEncoding);
            tag.Title = reader.readString(30, defaultEncoding);
            tag.Artist = reader.readString(30, defaultEncoding);
            tag.Album = reader.readString(30, defaultEncoding);
            tag.Year = reader.readString(4, defaultEncoding);
            tag.Comment = reader.readString(29, defaultEncoding);
            tag.Track = reader.readUnsignedByte();
            tag.Genre = reader.readUnsignedByte();
            return tag.Header.equals("TAG") ? tag : null;
        } catch (EOFException e) {
View Full Code Here

            tag.Header = reader.readString(3, defaultEncoding);
            tag.Title = reader.readString(30, defaultEncoding);
            tag.Artist = reader.readString(30, defaultEncoding);
            tag.Album = reader.readString(30, defaultEncoding);
            tag.Year = reader.readString(4, defaultEncoding);
            tag.Comment = reader.readString(29, defaultEncoding);
            tag.Track = reader.readUnsignedByte();
            tag.Genre = reader.readUnsignedByte();
            return tag.Header.equals("TAG") ? tag : null;
        } catch (EOFException e) {
            return null;
View Full Code Here

    public static APEHeaderOld read(final File file) throws IOException {
        try {
            APEHeaderOld header = new APEHeaderOld();
            final ByteArrayReader reader = new ByteArrayReader(file, APE_HEADER_OLD_BYTES);
            header.cID = reader.readString(4, "US-ASCII");
            header.nVersion = reader.readUnsignedShort();
            header.nCompressionLevel = reader.readUnsignedShort();
            header.nFormatFlags = reader.readUnsignedShort();
            header.nChannels = reader.readUnsignedShort();
            header.nSampleRate = reader.readUnsignedInt();
View Full Code Here

    public static APEDescriptor read(final File file) throws IOException {
        try {
            APEDescriptor header = new APEDescriptor();
            final ByteArrayReader reader = new ByteArrayReader(file, APE_DESCRIPTOR_BYTES - 16);
            header.cID = reader.readString(4, "US-ASCII");
            header.nVersion = reader.readUnsignedShort();
            reader.skipBytes(2);
            header.nDescriptorBytes = reader.readUnsignedInt();
            header.nHeaderBytes = reader.readUnsignedInt();
            header.nSeekTableBytes = reader.readUnsignedInt();
View Full Code Here

            throw new JMACException("Unsupported Format");

        // read the first 8 bytes of the descriptor (ID and version)
        m_pIO.mark(10);
        final ByteArrayReader reader = new ByteArrayReader(m_pIO, 8);
        if (!reader.readString(4, "US-ASCII").equals("MAC "))
            throw new JMACException("Unsupported Format");

        int version = reader.readUnsignedShort();

        m_pIO.reset();
View Full Code Here

            m_pIO.mark(1000);

            // skip an ID3v2 tag (which we really don't support anyway...)
            ByteArrayReader reader = new ByteArrayReader(10);
            reader.reset(m_pIO, 10);
            final String tag = reader.readString(3, "US-ASCII");
            if (tag.equals("ID3")) {
                // why is it so hard to figure the lenght of an ID3v2 tag ?!?
                reader.readByte();
                reader.readByte();
                int byte5 = reader.readUnsignedByte();
View Full Code Here

            return null;
        file.seek(pos);
        APETagFooter tag = new APETagFooter();
        try {
            final ByteArrayReader reader = new ByteArrayReader(file, APE_TAG_FOOTER_BYTES);
            tag.m_cID = reader.readString(8, "US-ASCII");
            tag.m_nVersion = reader.readInt();
            tag.m_nSize = reader.readInt();
            tag.m_nFields = reader.readInt();
            tag.m_nFlags = reader.readInt();
            return tag;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.