org.xerial.snappy.buffer.DefaultBufferAllocator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of snappy-java Show documentation
Show all versions of snappy-java Show documentation
snappy-java: A fast compression/decompression library
package org.xerial.snappy.buffer;
/**
* Simple buffer allocator, which does not reuse the allocated buffer
*/
public class DefaultBufferAllocator
implements BufferAllocator
{
public static BufferAllocatorFactory factory = new BufferAllocatorFactory()
{
public BufferAllocator singleton = new DefaultBufferAllocator();
@Override
public BufferAllocator getBufferAllocator(int bufferSize)
{
return singleton;
}
};
@Override
public byte[] allocate(int size)
{
return new byte[size];
}
@Override
public void release(byte[] buffer)
{
// do nothing
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy