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

com.kolibrifx.plovercrest.server.internal.folds.ByteArrayPeekableInputStream Maven / Gradle / Ivy

The newest version!
/*
 * Copyright (c) 2010-2017, KolibriFX AS. Licensed under the Apache License, version 2.0.
 */

package com.kolibrifx.plovercrest.server.internal.folds;

import java.nio.ByteBuffer;
import com.kolibrifx.plovercrest.server.streams.Stream;

public class ByteArrayPeekableInputStream extends AbstractPeekableInputStream {
    public ByteArrayPeekableInputStream(final Stream stream, final long fromTimestamp) {
        super(stream, fromTimestamp);
    }

    @Override
    protected byte[] convertElement(final ByteBuffer element) {
        final byte[] bytes = new byte[element.remaining()];
        element.get(bytes);
        return bytes;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy