Package com.fasterxml.util.membuf

Examples of com.fasterxml.util.membuf.StreamyBytesMemBuffer


            final long offset, final long dataLength,
            final StreamyBytesMemBuffer offHeap)
        throws IOException
    {
        final long fsWaitStart = (_diagnostics == null) ? 0L : _timeMaster.nanosForDiagnostics();
        final StreamyBytesMemBuffer fullBuffer = _throttler.performFileRead(StoreOperationSource.REQUEST,
                _operationTime, _entry.getRaw(), _file,
                new FileOperationCallback<StreamyBytesMemBuffer>() {
            @Override
            public StreamyBytesMemBuffer perform(long operationTime, StorableKey key, Storable value, File externalFile)
                throws IOException
View Full Code Here


    protected void _readAllWriteStreamingCompressedLZF(final InputStream in, final OutputStream out,
            final byte[] copyBuffer, final StreamyBytesMemBuffer offHeap)
        throws IOException
    {
        final long waitStart = (_diagnostics == null) ? 0L : _timeMaster.nanosForDiagnostics();
        StreamyBytesMemBuffer fullBuffer =_throttler.performFileRead(StoreOperationSource.REQUEST,
                _operationTime, _entry.getRaw(), _file,
                new FileOperationCallback<StreamyBytesMemBuffer>() {
            @SuppressWarnings("resource")
            @Override
            public StreamyBytesMemBuffer perform(long operationTime, StorableKey key, Storable value, File externalFile)
View Full Code Here

            final long offset, final long dataLength,
            final StreamyBytesMemBuffer offHeap)
        throws IOException
    {
        final long fsWaitStart = (_diagnostics == null) ? 0L : _timeMaster.nanosForDiagnostics();
        final StreamyBytesMemBuffer fullBuffer = _throttler.performFileRead(StoreOperationSource.REQUEST,
                _operationTime, _entry.getRaw(), _file,
                new FileOperationCallback<StreamyBytesMemBuffer>() {
            @Override
            public StreamyBytesMemBuffer perform(long operationTime, StorableKey key, Storable value, File externalFile)
                throws IOException
View Full Code Here

    protected void _readAllWriteStreamingCompressedLZF(final InputStream in, final OutputStream out,
            final byte[] copyBuffer, final StreamyBytesMemBuffer offHeap)
        throws IOException
    {
        final long waitStart = (_diagnostics == null) ? 0L : _timeMaster.nanosForDiagnostics();
        StreamyBytesMemBuffer fullBuffer =_throttler.performFileRead(StoreOperationSource.REQUEST,
                _operationTime, _entry.getRaw(), _file,
                new FileOperationCallback<StreamyBytesMemBuffer>() {
            @SuppressWarnings("resource")
            @Override
            public StreamyBytesMemBuffer perform(long operationTime, StorableKey key, Storable value, File externalFile)
View Full Code Here

    /**********************************************************************
     */

    private void _testStreamySkips(SegType aType) throws Exception
    {
        final StreamyBytesMemBuffer buffer = createBytesBuffers(aType, 10, 1, 4).createStreamyBuffer(1, 3);

        // append bytes in 5 pieces
        for (int i = 5; i >= 0; --i) {
            buffer.append(new byte[i]);
        }
        assertEquals(15, buffer.getTotalPayloadLength());
        assertFalse(buffer.isEmpty());

        // then skip all of it, in different order
        int left = 15;
        for (int i = 0; i <= 5; ++i) {
            assertEquals(i, buffer.skip(i));
            left -= i;
            assertEquals(left, buffer.getTotalPayloadLength());
        }
        assertEquals(0, buffer.getTotalPayloadLength());
        assertTrue(buffer.isEmpty());

        // and when empty, nothing more:
        assertEquals(0, buffer.skip(100));
        assertTrue(buffer.isEmpty());
    }
View Full Code Here

        assertTrue(buffer.isEmpty());
    }

    private void _testStreamySkipAndRead(SegType aType) throws Exception
    {
        final StreamyBytesMemBuffer buffer = createBytesBuffers(aType, 10, 1, 4).createStreamyBuffer(1, 3);

        for (int i = 5; i > 0; --i) { // 5, 4, 3, 2, 1 segments
            buffer.append(new byte[i]);
        }
        assertEquals(15, buffer.getTotalPayloadLength());
        assertFalse(buffer.isEmpty());

        // then skip all of it
        assertEquals(5, buffer.skip(5));
        byte[] b = new byte[4];
        assertEquals(4, buffer.read(b));
        assertEquals(6, buffer.getTotalPayloadLength());
        assertEquals(6, buffer.skip(100));
        assertEquals(0, buffer.skip(100));
        assertTrue(buffer.isEmpty());
    }
View Full Code Here

    }

    // Test to verify that skip works across buffer boundaries
    private void _testStreamyLongerSkip(SegType aType) throws Exception
    {
        final StreamyBytesMemBuffer buffer = createBytesBuffers(aType, 10, 1, 4).createStreamyBuffer(1, 3);
        buffer.append(new byte[30]);
        assertEquals(30, buffer.skip(32));
        assertEquals(0, buffer.skip(1));
        assertTrue(buffer.isEmpty());
    }
View Full Code Here

    protected void _readAllWriteStreamingCompressedLZF(final InputStream in, final OutputStream out,
            final byte[] copyBuffer, final StreamyBytesMemBuffer offHeap)
        throws IOException
    {
        final long waitStart = (_diagnostics == null) ? 0L : _timeMaster.nanosForDiagnostics();
        StreamyBytesMemBuffer rest =_throttler.performFileRead(StoreOperationSource.REQUEST,
                _operationTime, _entry.getRaw(), _file,
                new FileOperationCallback<StreamyBytesMemBuffer>() {
            @SuppressWarnings("resource")
            @Override
            public StreamyBytesMemBuffer perform(long operationTime, StorableKey key, Storable value, File externalFile)
View Full Code Here

            final long offset, final long dataLength,
            final StreamyBytesMemBuffer offHeap)
        throws IOException
    {
        final long fsWaitStart = (_diagnostics == null) ? 0L : _timeMaster.nanosForDiagnostics();
        final StreamyBytesMemBuffer fullBuffer = _throttler.performFileRead(StoreOperationSource.REQUEST,
                _operationTime, _entry.getRaw(), _file,
                new FileOperationCallback<StreamyBytesMemBuffer>() {
            @Override
            public StreamyBytesMemBuffer perform(long operationTime, StorableKey key, Storable value, File externalFile)
                throws IOException
View Full Code Here

    protected void _readAllWriteStreamingCompressedLZF(final InputStream in, final OutputStream out,
            final byte[] copyBuffer, final StreamyBytesMemBuffer offHeap)
        throws IOException
    {
        final long waitStart = (_diagnostics == null) ? 0L : _timeMaster.nanosForDiagnostics();
        StreamyBytesMemBuffer fullBuffer =_throttler.performFileRead(StoreOperationSource.REQUEST,
                _operationTime, _entry.getRaw(), _file,
                new FileOperationCallback<StreamyBytesMemBuffer>() {
            @SuppressWarnings("resource")
            @Override
            public StreamyBytesMemBuffer perform(long operationTime, StorableKey key, Storable value, File externalFile)
View Full Code Here

TOP

Related Classes of com.fasterxml.util.membuf.StreamyBytesMemBuffer

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.