Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package com.fasterxml.util.membuf;
 
Factory for creating ChunkyBytesMemBuffers, memory buffers that contain byte sequences.

Default segments use java.nio.ByteBuffer for store byte sequences; this can be overridden by specifying alternate SegmentAllocator implementation.

public class MemBuffersForLongs extends MemBuffersBase<
    /*
    /**********************************************************************
    /* Life-cycle
    /**********************************************************************
     */

    
Constructor that will create a default SegmentAllocator instance with given arguments, and use that allocator for creating MemBuffer instances.

Parameters:
segmentSize Size of segments allocated for buffers
segmentsToRetain Maximum number of segments allocator may reuse (see SegmentAllocator for details)
maxSegments Maximum number of allocated (and not released) segments allowed at any given point (see SegmentAllocator for details)
    public MemBuffersForLongs(int segmentSizeint segmentsToRetainint maxSegments)
    {
        this(ByteBufferLongsSegment.allocator(segmentSizesegmentsToRetainmaxSegmentstrue));
    }
    public MemBuffersForLongs(SegmentAllocator<LongsSegmentallocator) {
        super(allocatornullnull);
    }
            MemBufferDecorator<ChunkyLongsMemBufferchunkyDecorator,
            MemBufferDecorator<StreamyLongsMemBufferstreamyDecorator)
    {
        super(allocatorchunkyDecoratorstreamyDecorator);
    }
    
        return new MemBuffersForLongs(allocator);
    }
        return new MemBuffersForLongs(chunkyDecorator);
    }
        return new MemBuffersForLongs(streamyDecorator);
    }
    /*
    /**********************************************************************
    /* Abstract method impls
    /**********************************************************************
     */
    @Override
    protected ChunkyLongsMemBuffer _createChunkyBuffer(int minSegmentsForBufferint maxSegmentsForBuffer,
            LongsSegment initialSegments)
    {
        return new ChunkyLongsMemBufferImpl(minSegmentsForBuffermaxSegmentsForBuffer,
                initialSegments);
    }
    @Override
    protected StreamyLongsMemBuffer _createStreamyBuffer(int minSegmentsForBufferint maxSegmentsForBuffer,
            LongsSegment initialSegments)
    {
        return new StreamyLongsMemBufferImpl(minSegmentsForBuffermaxSegmentsForBuffer,
                initialSegments);
    }
New to GrepCode? Check out our FAQ X