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 Details

    • IOBuffer

      public IOBuffer​(HasCoreLocation core, byte[] contents)
      Parameters:
      core - The coordinates of a core
      contents - The contents of the buffer for the chip
    • IOBuffer

      public IOBuffer​(HasCoreLocation core, ByteBuffer contents)
      Parameters:
      core - The coordinates of a core
      contents - The contents of the buffer for the chip
    • IOBuffer

      public IOBuffer​(HasCoreLocation core, Iterable<ByteBuffer> contents)
      Parameters:
      core - The coordinates of a core
      contents - The contents of the buffer for the chip
  • Method Details

    • getX

      public int getX()
      Specified by:
      getX in interface HasChipLocation
      Returns:
      The X coordinate of the chip.
    • getY

      public int getY()
      Specified by:
      getY in interface HasChipLocation
      Returns:
      The Y coordinate of the chip.
    • getP

      public int getP()
      Specified by:
      getP in interface HasCoreLocation
      Returns:
      The processor coordinate of the core on its chip.
    • getContentsStream

      public InputStream getContentsStream()
      Returns:
      The raw contents of the buffer as an input stream.
    • getContentsBuffer

      public ByteBuffer getContentsBuffer()
      Returns:
      The raw contents of the buffer as a read-only little-endian byte buffer.
    • getContentsString

      public String getContentsString()
      Returns:
      The contents of the buffer as a string, interpreting it as ASCII.
    • getContentsString

      public String getContentsString​(Charset charset)
      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.