Package net.sf.ehcache.util

Examples of net.sf.ehcache.util.MemoryEfficientByteArrayOutputStream.toByteArray()


                bufferLength = buffer.size();
                DiskElement diskElement = checkForFreeBlock(bufferLength);

                // Write the record
                randomAccessFile.seek(diskElement.position);
                randomAccessFile.write(buffer.toByteArray(), 0, bufferLength);
                buffer = null;

                // Add to index, update stats
                diskElement.payloadSize = bufferLength;
                diskElement.key = key;
View Full Code Here


                DiskElement diskElement = checkForFreeBlock(bufferLength);

                // Write the record
                synchronized (randomAccessFile) {
                    randomAccessFile.seek(diskElement.position);
                    randomAccessFile.write(buffer.toByteArray(), 0, bufferLength);
                }
                buffer = null;

                // Add to index, update stats
                diskElement.payloadSize = bufferLength;
View Full Code Here

        DiskMarker marker = alloc(element, bufferLength);
        // Write the record
        RandomAccessFile data = getDataAccess(element.getObjectKey());
        synchronized (data) {
            data.seek(marker.getPosition());
            data.write(buffer.toByteArray(), 0, bufferLength);
        }
        return marker;
    }

    private MemoryEfficientByteArrayOutputStream serializeElement(Element element) throws IOException {
View Full Code Here

                DiskElement diskElement = checkForFreeBlock(bufferLength);
                // Write the record
                RandomAccessFile randomAccessFile = selectRandomAccessFile(key);
                synchronized (randomAccessFile) {
                    randomAccessFile.seek(diskElement.position);
                    randomAccessFile.write(buffer.toByteArray(), 0, bufferLength);
                }
                buffer = null;
                // Add to index, update stats
                diskElement.payloadSize = bufferLength;
                diskElement.key = key;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.