Package br.com.caelum.stella.boleto

Examples of br.com.caelum.stella.boleto.GeracaoBoletoException


    private void tryToClose(Closeable c) {
        try {
            c.close();
        } catch (IOException e) {
            throw new GeracaoBoletoException("Erro ao fechar stream", e);
        }
    }
View Full Code Here


            byte[] b = toPNG();

            fos.write(b);
        } catch (FileNotFoundException e) {
            throw new GeracaoBoletoException("Erro na geração do boleto em PNG", e);
        } catch (IOException e) {
            throw new GeracaoBoletoException("Erro na geração do boleto em PNG", e);
        } finally {
            tryToClose(fos);
        }

    }
View Full Code Here

        try {
            b = new byte[is.available()];
            is.read(b);

        } catch (NumberFormatException e) {
            throw new GeracaoBoletoException("Erro na geração do boleto em PDF", e);
        } catch (IOException e) {
            throw new GeracaoBoletoException("Erro na geração do boleto em PDF", e);
        } finally {
            tryToClose(is);
        }
        return b;
    }
View Full Code Here

        if (this.stream == null) {
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            try {
                ImageIO.write(this.PNGimage, "PNG", baos);
            } catch (IOException e) {
                throw new GeracaoBoletoException(e); // nao esperado
            }
            this.stream = new ByteArrayInputStream(baos.toByteArray());
        }
        return this.stream;
    }
View Full Code Here

TOP

Related Classes of br.com.caelum.stella.boleto.GeracaoBoletoException

Copyright © 2018 www.massapicom. 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.