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

org.jitsi.impl.neomedia.protocol.NullBufferTransferHandler Maven / Gradle / Ivy

Go to download

libjitsi is an advanced Java media library for secure real-time audio/video communication

The newest version!
/*
 * Copyright @ 2015 Atlassian Pty Ltd
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.jitsi.impl.neomedia.protocol;

import javax.media.*;
import javax.media.protocol.*;

/**
 * Implements a BufferTransferHandler which reads from a specified
 * PushBufferStream as soon as possible and throws the read data away.
 *
 * @author Lyubomir Marinov
 */
public class NullBufferTransferHandler
    implements BufferTransferHandler
{
    /**
     * The FMJ Buffer into which this BufferTransferHandler is
     * to read data from any PushBufferStream.
     */
    private final Buffer buffer = new Buffer();

    @Override
    public void transferData(PushBufferStream stream)
    {
        try
        {
            stream.read(buffer);
        }
        catch (Exception ex)
        {
            // The purpose of NullBufferTransferHandler is to read from the
            // specified PushBufferStream as soon as possible and throw the read
            // data away. Hence, Exceptions are of no concern.
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy