Package com.totalchange.jizz.data.blobs

Examples of com.totalchange.jizz.data.blobs.JizzBlobWriter


                jizzBlobStore instanceof JizzBlobStoreJpaImpl);
    }

    @Test
    public void testBlobbing() throws IOException {
        JizzBlobWriter writer = jizzBlobStore.createBlob();
        InputStream inTest = getTestStream();
        OutputStream outBlob = writer.getOutputStream();
        JizzBlobUtils.copyStream(inTest, outBlob);
        outBlob.close();
        inTest.close();

        String id = writer.commit();

        // Check can get back the committed blob
        JizzBlobReader reader = jizzBlobStore.retrieveBlob(id);

        // Compare to the test stream
View Full Code Here


        JizzStation mockStation = new JizzStation();
        mockStation.setKey(UUID.randomUUID().toString());

        replayAll();

        JizzBlobWriter writer = jizzBlobServices.createBlob(mockStation);
        InputStream inTest = getTestStream();
        OutputStream outBlob = writer.getOutputStream();
        JizzBlobUtils.copyStream(inTest, outBlob);
        outBlob.close();
        inTest.close();

        String id = writer.commit();

        verifyAll();
        resetAll();

        final ByteArrayInputStream encryptedIn = new ByteArrayInputStream(
View Full Code Here

        song.setEncoding(true);
        song = jizzSongDao.createOrUpdateSong(song);

        JizzBlobReader masterBlob = jizzBlobServices.retrieveBlob(station,
                song.getMasterBlobRef());
        JizzBlobWriter encodedBlob = jizzBlobServices.createBlob(station);

        JizzTrackAudioFormat format = new JizzTrackAudioFormat();
        format.setFormat(JizzTrackAudioFormat.Format.MP3);
        format.setBitRate(DEFAULT_BIT_RATE);

        try {
            logger.trace("Doing transcoding");
            song.setLength(jizzTrackServices.transcode(format, masterBlob,
                    encodedBlob));
        } catch (Throwable th) {
            logger.info("Failed to transcode song " + song + ", deleting it",
                    th);
            jizzEmailServices.sendUnsupportedSongTypeEmail(song.getDj(), song);

            deleteSong(station, song);
            return null;
        }

        logger.trace("Transcoded, committing encoded blob");
        String encodedBlobRef = encodedBlob.commit();

        JizzSongEncoding encoding = new JizzSongEncoding();
        encoding.setFormat(format.getFormat().name());
        encoding.setBitRateKbps(format.getBitRate());
        encoding.setBlobRef(encodedBlobRef);
View Full Code Here

TOP

Related Classes of com.totalchange.jizz.data.blobs.JizzBlobWriter

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.