Package org.apache.harmony.luni.platform

Examples of org.apache.harmony.luni.platform.PlatformAddress


        if (position + size > size()) {
            fileSystem.truncate(handle, position + size);
        }
        long alignment = position - position % ALLOC_GRANULARITY;
        int offset = (int) (position - alignment);
        PlatformAddress address = PlatformAddressFactory.allocMap(handle,
                alignment, size + offset, mapMode);
        MappedByteBuffer buffer = null;
        try {
            buffer = MappedByteBufferFactory.getBuffer(address, mapMode, size,
                    offset);
View Full Code Here


        if (position + size > size()) {
            fileSystem.truncate(handle, position + size);
        }
        long alignment = position - position % NATIVE_PAGE_SIZE;
        int offset = (int) (position - alignment);
        PlatformAddress address = PlatformAddressFactory.allocMap(handle, alignment, size
                + offset, mapMode);
        MappedByteBuffer buffer = null;
        try {
            buffer = MappedByteBufferFactory.getBuffer(address, mapMode, size,
                    offset);
View Full Code Here

        return ReadOnlyDirectByteBuffer.copy(this, mark);
    }

    @Override
    public ByteBuffer compact() {
        PlatformAddress effectiveAddress = getEffectiveAddress();
        effectiveAddress.offsetBytes(position).moveTo(effectiveAddress,
                remaining());
        position = limit - position;
        limit = capacity;
        mark = UNSET_MARK;
        return this;
View Full Code Here

     * form.
     * </p>
     */
    public final void free() {
        if (isAddressValid()) {
            PlatformAddress a = address;
            address = PlatformAddress.INVALID;
            a.free();
        }
    }
View Full Code Here

        if (position + size > size()) {
            fileSystem.truncate(handle, position + size);
        }
        long alignment = position - position % ALLOC_GRANULARITY;
        int offset = (int) (position - alignment);
        PlatformAddress address = PlatformAddressFactory.allocMap(handle,
                alignment, size + offset, mapMode);
        MappedByteBuffer buffer = null;
        try {
            buffer = MappedByteBufferFactory.getBuffer(address, mapMode, size,
                    offset);
View Full Code Here

  public ByteBuffer asReadOnlyBuffer() {
    return ReadOnlyDirectByteBuffer.copy(this, mark);
  }

  public ByteBuffer compact() {
    PlatformAddress effectiveAddress = getEffectiveAddress();
    effectiveAddress.offsetBytes(position).moveTo(effectiveAddress,
        remaining());
    position = limit - position;
    limit = capacity;
    mark = UNSET_MARK;
    return this;
View Full Code Here

        if (position + size > size()) {
            fileSystem.truncate(handle, position + size);
        }
        long alignment = position - position % ALLOC_GRANULARITY;
        int offset = (int) (position - alignment);
        PlatformAddress address = PlatformAddressFactory.allocMap(handle, alignment, size
                + offset, mapMode);
        MappedByteBuffer buffer = null;
        try {
            buffer = MappedByteBufferFactory.getBuffer(address, mapMode, size,
                    offset);
View Full Code Here

        if (position + size > size()) {
            fileSystem.truncate(handle, position + size);
        }
        long alignment = position - position % ALLOC_GRANULARITY;
        int offset = (int) (position - alignment);
        PlatformAddress address = PlatformAddressFactory.allocMap(handle,
                alignment, size + offset, mapMode);
        MappedByteBuffer buffer = null;
        try {
            buffer = MappedByteBufferFactory.getBuffer(address, mapMode, size,
                    offset);
View Full Code Here

     * form.
     * </p>
     */
    public final void free() {
        if (isAddressValid()) {
            PlatformAddress a = address;
            address = PlatformAddress.INVALID;
            a.free();
        }
    }
View Full Code Here

        return ReadOnlyDirectByteBuffer.copy(this, mark);
    }

    @Override
    public ByteBuffer compact() {
        PlatformAddress effectiveAddress = getEffectiveAddress();
        effectiveAddress.offsetBytes(position).moveTo(effectiveAddress,
                remaining());
        position = limit - position;
        limit = capacity;
        mark = UNSET_MARK;
        return this;
View Full Code Here

TOP

Related Classes of org.apache.harmony.luni.platform.PlatformAddress

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.