Package libcore.io

Class MemoryMappedFile

    • Constructor Detail

      • MemoryMappedFile

        public MemoryMappedFile​(long address,
                                long size)
        Use this if you've called mmap yourself.
    • Method Detail

      • close

        public void close()
                   throws ErrnoException
        Unmaps this memory-mapped file using munmap(2). This is a no-op if close has already been called. Note that this class does not use finalization; you must call close yourself. Calling this method invalidates any iterators over this MemoryMappedFile. It is an error to use such an iterator after calling close.
        Specified by:
        close in interface AutoCloseable
        Throws:
        ErrnoException
      • bigEndianIterator

        public BufferIterator bigEndianIterator()
        Returns a new iterator that treats the mapped data as big-endian.
      • littleEndianIterator

        public BufferIterator littleEndianIterator()
        Returns a new iterator that treats the mapped data as little-endian.
      • size

        public long size()
        Returns the size in bytes of the memory-mapped region.