Package davaguine.jmac.tools

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


    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();
            header.nHeaderDataBytes = reader.readUnsignedInt();
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();
            header.nHeaderBytes = reader.readUnsignedInt();
View Full Code Here

        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();
            header.nHeaderBytes = reader.readUnsignedInt();
            header.nTerminatingBytes = reader.readUnsignedInt();
View Full Code Here

            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();
            header.nHeaderBytes = reader.readUnsignedInt();
            header.nTerminatingBytes = reader.readUnsignedInt();
            header.nTotalFrames = reader.readUnsignedInt();
View Full Code Here

            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();
            header.nHeaderBytes = reader.readUnsignedInt();
            header.nTerminatingBytes = reader.readUnsignedInt();
            header.nTotalFrames = reader.readUnsignedInt();
            header.nFinalFrameBlocks = 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();
            header.nHeaderDataBytes = reader.readUnsignedInt();
View Full Code Here

        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();

        if (version >= 3980) {
            // current header format
View Full Code Here

    public static APEHeaderNew read(final File file) throws IOException {
        try {
            APEHeaderNew header = new APEHeaderNew();
            final ByteArrayReader reader = new ByteArrayReader(file, APE_HEADER_BYTES);
            header.nCompressionLevel = reader.readUnsignedShort();
            header.nFormatFlags = reader.readUnsignedShort();
            header.nBlocksPerFrame = reader.readUnsignedInt();
            header.nFinalFrameBlocks = reader.readUnsignedInt();
            header.nTotalFrames = reader.readUnsignedInt();
            header.nBitsPerSample = reader.readUnsignedShort();
View Full Code Here

    public static APEHeaderNew read(final File file) throws IOException {
        try {
            APEHeaderNew header = new APEHeaderNew();
            final ByteArrayReader reader = new ByteArrayReader(file, APE_HEADER_BYTES);
            header.nCompressionLevel = reader.readUnsignedShort();
            header.nFormatFlags = reader.readUnsignedShort();
            header.nBlocksPerFrame = reader.readUnsignedInt();
            header.nFinalFrameBlocks = reader.readUnsignedInt();
            header.nTotalFrames = reader.readUnsignedInt();
            header.nBitsPerSample = reader.readUnsignedShort();
            header.nChannels = reader.readUnsignedShort();
View Full Code Here

            header.nCompressionLevel = reader.readUnsignedShort();
            header.nFormatFlags = reader.readUnsignedShort();
            header.nBlocksPerFrame = reader.readUnsignedInt();
            header.nFinalFrameBlocks = reader.readUnsignedInt();
            header.nTotalFrames = reader.readUnsignedInt();
            header.nBitsPerSample = reader.readUnsignedShort();
            header.nChannels = reader.readUnsignedShort();
            header.nSampleRate = reader.readUnsignedInt();
            return header;
        } catch (EOFException e) {
            throw new JMACException("Unsupported Format");
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.