Package davaguine.jmac.tools

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


    public final static ID3Tag read(final File file) throws IOException {
        file.seek(file.length() - ID3_TAG_BYTES);
        try {
            final ID3Tag tag = new ID3Tag();
            final ByteArrayReader reader = new ByteArrayReader(file, ID3_TAG_BYTES);
            tag.Header = reader.readString(3, "US-ASCII");
            tag.Title = reader.readString(30, "US-ASCII");
            tag.Artist = reader.readString(30, "US-ASCII");
            tag.Album = reader.readString(30, "US-ASCII");
            tag.Year = reader.readString(4, "US-ASCII");
            tag.Comment = reader.readString(29, "US-ASCII");
View Full Code Here


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

        try {
            final ID3Tag tag = new ID3Tag();
            final ByteArrayReader reader = new ByteArrayReader(file, ID3_TAG_BYTES);
            tag.Header = reader.readString(3, "US-ASCII");
            tag.Title = reader.readString(30, "US-ASCII");
            tag.Artist = reader.readString(30, "US-ASCII");
            tag.Album = reader.readString(30, "US-ASCII");
            tag.Year = reader.readString(4, "US-ASCII");
            tag.Comment = reader.readString(29, "US-ASCII");
            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, "US-ASCII");
            tag.Title = reader.readString(30, "US-ASCII");
            tag.Artist = reader.readString(30, "US-ASCII");
            tag.Album = reader.readString(30, "US-ASCII");
            tag.Year = reader.readString(4, "US-ASCII");
            tag.Comment = reader.readString(29, "US-ASCII");
            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, "US-ASCII");
            tag.Title = reader.readString(30, "US-ASCII");
            tag.Artist = reader.readString(30, "US-ASCII");
            tag.Album = reader.readString(30, "US-ASCII");
            tag.Year = reader.readString(4, "US-ASCII");
            tag.Comment = reader.readString(29, "US-ASCII");
            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, "US-ASCII");
            tag.Title = reader.readString(30, "US-ASCII");
            tag.Artist = reader.readString(30, "US-ASCII");
            tag.Album = reader.readString(30, "US-ASCII");
            tag.Year = reader.readString(4, "US-ASCII");
            tag.Comment = reader.readString(29, "US-ASCII");
            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 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

    public static APETagFooter read(final File file) throws IOException {
        file.seek(file.length() - APE_TAG_FOOTER_BYTES);
        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

            return null;
        file.seek(offset);
        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);
View Full Code Here

        file.seek(offset);
        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();
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.