Package xbird.util.nio

Examples of xbird.util.nio.CloseableMappedByteBuffer


        return newPage[offset];
    }

    private long dataAt_RW(final long at) {
        final long pageOffset = directToPageOffset(at);
        final CloseableMappedByteBuffer buf = _mmfile.allocateBuffer(pageOffset);
        final int offset = ((int) (at & LOGICAL_PAGE_MASK)) << 2;
        final long res = buf.getBuffer().getInt(offset); // TODO getInt should be refined
        //IOUtils.closeQuietly(buf);
        return res;
    }
View Full Code Here


    }

    protected void setData(final long at, final long value) {
        assert (!_readOnly) : "update is not allowed for readOnly mode";
        final long pageOffset = directToPageOffset(at);
        final CloseableMappedByteBuffer buf = _mmfile.allocateBuffer(pageOffset);
        final int offset = ((int) (at & LOGICAL_PAGE_MASK)) << 2;
        buf.getBuffer().putInt(offset, (int) value);
        //IOUtils.closeQuietly(buf);
    }
View Full Code Here

    }

    protected void setFlag(final long at, final int flag) {
        assert (!_readOnly) : "update is not allowed for readOnly mode";
        final long pageOffset = directToPageOffset(at);
        final CloseableMappedByteBuffer buf = _mmfile.allocateBuffer(pageOffset);
        final int offset = ((int) (at & LOGICAL_PAGE_MASK)) << 2;
        final ByteBuffer bufimpl = buf.getBuffer();
        final int old = bufimpl.getInt(offset);
        bufimpl.putInt(offset, old | flag);
        //IOUtils.closeQuietly(buf);
    }
View Full Code Here

        return newPage[offset];
    }

    private long dataAt_RW(final long at) {
        final long pageOffset = directToPageOffset(at);
        final CloseableMappedByteBuffer buf = _mmfile.allocateBuffer(pageOffset);
        final int offset = ((int) (at & LOGICAL_PAGE_MASK)) << 2;
        final long res = buf.getBuffer().getInt(offset); // TODO getInt should be refined
        //IOUtils.closeQuietly(buf);
        return res;
    }
View Full Code Here

    }

    protected void setData(final long at, final long value) {
        assert (!_readOnly) : "update is not allowed for readOnly mode";
        final long pageOffset = directToPageOffset(at);
        final CloseableMappedByteBuffer buf = _mmfile.allocateBuffer(pageOffset);
        final int offset = ((int) (at & LOGICAL_PAGE_MASK)) << 2;
        buf.getBuffer().putInt(offset, (int) value);
        //IOUtils.closeQuietly(buf);
    }
View Full Code Here

    }

    protected void setFlag(final long at, final int flag) {
        assert (!_readOnly) : "update is not allowed for readOnly mode";
        final long pageOffset = directToPageOffset(at);
        final CloseableMappedByteBuffer buf = _mmfile.allocateBuffer(pageOffset);
        final int offset = ((int) (at & LOGICAL_PAGE_MASK)) << 2;
        final ByteBuffer bufimpl = buf.getBuffer();
        final int old = bufimpl.getInt(offset);
        bufimpl.putInt(offset, old | flag);
        //IOUtils.closeQuietly(buf);
    }
View Full Code Here

TOP

Related Classes of xbird.util.nio.CloseableMappedByteBuffer

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.