Package com.totalchange.jizz.data.blobs

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


        inTest.close();

        String id = writer.commit();

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

        // Compare to the test stream
        InputStream inBlob = reader.getInputStream();
        inTest = getTestStream();

        int bT;
        while ((bT = inTest.read()) > -1) {
            int bB = inBlob.read();
            assertEquals("Retrieved blob data matches test data", bT, bB);
        }
        inBlob.close();
        inTest.close();
        reader.close();

        // Finally delete it and then make sure it no longer exists
        jizzBlobStore.deleteBlob(id);
        try {
            reader = jizzBlobStore.retrieveBlob(id);
View Full Code Here


        mockBlobStoreReader.close();

        replayAll();

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

        // Compare to the test stream
        InputStream inBlob = reader.getInputStream();
        inTest = getTestStream();

        int bT;
        while ((bT = inTest.read()) > -1) {
            int bB = inBlob.read();
            assertEquals("Retrieved blob data matches test data", bT, bB);
        }
        inBlob.close();
        inTest.close();
        reader.close();

        verifyAll();
        resetAll();

        mockBlobStore.deleteBlob(id);
View Full Code Here

    @Override
    public TimedInputStream openNewDataConnection() {
        logger.trace("openNewDataConnection() fetching blob for encoding {}",
                encoding);
        final JizzBlobReader blobReader = jizzBlobServices.retrieveBlob(
                station, encoding.getBlobRef());

        // Want to ensure the enclosing blob reader gets closed when the input
        // stream is finished with
        return new CbrTimedInputStream(blobReader.getInputStream(),
                encoding.getBitRateKbps()) {
            @Override
            public void close() throws IOException {
                logger.trace("Calling super.close()");
                super.close();

                logger.trace("Closing enclosing blob reader");
                blobReader.close();
            }
        };
    }
View Full Code Here

    }

    private JizzSong grabSongMetadata(JizzStation station, JizzSong song) {
        logger.trace("Looking up track info for song {}", song);

        JizzBlobReader blob = jizzBlobServices.retrieveBlob(station,
                song.getMasterBlobRef());
        JizzTrackInfo info = jizzTrackServices.getTrackInfo(blob);

        if (info != null) {
            song.setArtist(info.getArtist());
View Full Code Here

        // Set a polite flag to say it's in process. If anything bad happens
        // the transaction will roll back and the flag will be reset
        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);
View Full Code Here

TOP

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

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.