All Downloads are FREE. Search and download functionalities are using the official Maven repository.

de.jarnbjo.flac.FlacFormatException Maven / Gradle / Ivy

package de.jarnbjo.flac;

import de.jarnbjo.util.io.ByteArrayBitInputStream;
import java.io.IOException;

public class FlacFormatException extends IOException {
    private ByteArrayBitInputStream source;

    public FlacFormatException() {
    }

    public FlacFormatException(String message) {
        super(message);
    }

    public FlacFormatException(String message, ByteArrayBitInputStream source) {
        super(message);
        this.source = source;
    }

    @Override
    public void printStackTrace() {
        super.printStackTrace();
        if (source != null) {
            for (int i = 0; i < source.getSource().length;) {
                int lineEnd = i + 8;
                for (; i < lineEnd && i < source.getSource().length; i++) {
                    String val = Integer.toBinaryString(
                            ((int) source.getSource()[i]) & 0xff);
                    while (val.length() < 8) {
                        val = "0" + val;
                    }
                    System.err.print(val + " ");
                }
                System.err.println();
            }
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy