class ChannelReadOnlyMemory extends ReadOnlyMemory
A read-only memory backed by a SeekableByteChannel
, e.g. a file. This
implementation reads part of the file into a cache and tries to serve the data from this cache.
- Alphabetic
- By Inheritance
- ChannelReadOnlyMemory
- ReadOnlyMemory
- Memory
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new ChannelReadOnlyMemory(data: SeekableByteChannel)
- data
the data of the read-only memory
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##(): Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- val data: SeekableByteChannel
- def doRead(address: Long): Try[Byte]
The read method which caches a block of data and returns the value to be read from the cache.
The read method which caches a block of data and returns the value to be read from the cache.
- address
the address to read
- returns
a
Success
with the byte read at the given address or aFailure
- Attributes
- protected
- Definition Classes
- ChannelReadOnlyMemory → ReadOnlyMemory
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def readByte(address: Long): Try[Byte]
Read a single byte from the memory at the given address.
Read a single byte from the memory at the given address.
- address
the
address
to read from- returns
a
Success
with the byte read,Failure
otherwise
- Definition Classes
- ReadOnlyMemory → Memory
- final def readInt(address: Long): Try[Int]
Read an
Int
from the memory ataddress ... address + 3
.Read an
Int
from the memory ataddress ... address + 3
. The value ofaddress
will be the least significantByte
.- address
the
address
to read from- returns
a
Success
with theInt
read or aFailure
- Definition Classes
- Memory
- final def readLong(address: Long): Try[Long]
Read a
Long
from the memory ataddress ... address + 7
.Read a
Long
from the memory ataddress ... address + 7
. The value ofaddress
will be the least significantByte
.- address
the
address
to read from- returns
a
Success
with theLong
read or aFailure
- Definition Classes
- Memory
- final def readShort(address: Long): Try[Short]
Read a
Short
from the memory ataddress ... address + 1
.Read a
Short
from the memory ataddress ... address + 1
. The value ofaddress
will be the least significantByte
.- address
the
address
to read from- returns
a
Success
with theShort
read or aFailure
- Definition Classes
- Memory
- def size: Long
Returns the size of the memory.
Returns the size of the memory.
- returns
the size of the memory
- Definition Classes
- ChannelReadOnlyMemory → Memory
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def writeByte(address: Long, value: Byte): Try[Unit]
Write a single byte to the memory at the given address.
Write a single byte to the memory at the given address.
- address
the address to write
- value
the value to write
- returns
a
Failure
when the address is outside the area of the memory
- Definition Classes
- ReadOnlyMemory → Memory
- final def writeInt(address: Long, value: Int): Try[Unit]
Write an
Int
ataddress ... address + 3
.Write an
Int
ataddress ... address + 3
. The least significantByte
will be written toaddress
.- address
the
address
to write to- value
the
value
to write- returns
a
Success
when the int was written successfully or aFailure
otherwise
- Definition Classes
- Memory
- final def writeLong(address: Long, value: Long): Try[Unit]
Write a
Long
ataddress ... address + 7
.Write a
Long
ataddress ... address + 7
. The least significantByte
will be written toaddress
.- address
the
address
to write to- value
the
value
to write- returns
a
Success
when the long was written successfully or aFailure
otherwise
- Definition Classes
- Memory
- final def writeShort(address: Long, value: Short): Try[Unit]
Write a
Short
toaddress ... address + 1
.Write a
Short
toaddress ... address + 1
. The least significantByte
will be written toaddress
.- address
the
address
to write to- value
the
value
to write- returns
a
Success
when the short was written successfully or aFailure
otherwise
- Definition Classes
- Memory