Class IOBuffer
java.lang.Object
uk.ac.manchester.spinnaker.messages.model.IOBuffer
- All Implemented Interfaces:
HasChipLocation
,HasCoreLocation
public class IOBuffer extends Object implements HasCoreLocation
The contents of IOBUF for a core.
- Author:
- Donal Fellows
-
Constructor Summary
Constructors Constructor Description IOBuffer(HasCoreLocation core, byte[] contents)
IOBuffer(HasCoreLocation core, Iterable<ByteBuffer> contents)
IOBuffer(HasCoreLocation core, ByteBuffer contents)
-
Method Summary
Modifier and Type Method Description ByteBuffer
getContentsBuffer()
InputStream
getContentsStream()
String
getContentsString()
String
getContentsString(Charset charset)
Get the contents of the buffer as a string.int
getP()
int
getX()
int
getY()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface uk.ac.manchester.spinnaker.machine.HasChipLocation
asChipLocation, getScampCore, onSameChipAs
Methods inherited from interface uk.ac.manchester.spinnaker.machine.HasCoreLocation
asCoreLocation, onSameCoreAs
-
Constructor Details
-
IOBuffer
- Parameters:
core
- The coordinates of a corecontents
- The contents of the buffer for the chip
-
IOBuffer
- Parameters:
core
- The coordinates of a corecontents
- The contents of the buffer for the chip
-
IOBuffer
- Parameters:
core
- The coordinates of a corecontents
- The contents of the buffer for the chip
-
-
Method Details
-
getX
public int getX()- Specified by:
getX
in interfaceHasChipLocation
- Returns:
- The X coordinate of the chip.
-
getY
public int getY()- Specified by:
getY
in interfaceHasChipLocation
- Returns:
- The Y coordinate of the chip.
-
getP
public int getP()- Specified by:
getP
in interfaceHasCoreLocation
- Returns:
- The processor coordinate of the core on its chip.
-
getContentsStream
- Returns:
- The raw contents of the buffer as an input stream.
-
getContentsBuffer
- Returns:
- The raw contents of the buffer as a read-only little-endian byte buffer.
-
getContentsString
- Returns:
- The contents of the buffer as a string, interpreting it as ASCII.
-
getContentsString
Get the contents of the buffer as a string.- Parameters:
charset
- How to decode bytes into characters.- Returns:
- The contents of the buffer as a string in the specified encoding.
-