Package de.uniluebeck.itm.tcpip

Examples of de.uniluebeck.itm.tcpip.Storage


      (byte) (AN_INTEGER >> 16),
      (byte) (AN_INTEGER >>  8),
      (byte) (AN_INTEGER      )
    };
   
    return new Storage(buf);
  }
View Full Code Here


  }

  @Test
  public void testWriteRawTo() {
    Command cmd = new Command(sampleStorage());
    Storage s = new Storage();
    cmd.writeRawTo(s);
    Iterator<Byte> bytes = s.getStorageList().iterator();
    assertEquals(0, (int)bytes.next());
    assertEquals(0, (int)bytes.next());
    assertEquals(0, (int)bytes.next());
    assertEquals(0, (int)bytes.next());
    assertEquals(10, (int)bytes.next());
View Full Code Here

    super(dis, dos, commandID, objectID, varID);
  }

  @Override
  protected Program readValue(Command resp) throws TraCIException {
    Storage content = resp.content();
    return new Program(content);
  }
View Full Code Here

  public void setUp() throws Exception {
  }

  @Test
  public void testCommandStorage() {
    Storage s = sampleStorage();
    new Command(s);
  }
View Full Code Here

      (byte) (AN_INTEGER >> 16),
      (byte) (AN_INTEGER >>  8),
      (byte) (AN_INTEGER      )
    };
   
    return new Storage(buf);
  }
View Full Code Here

  }

  @Test
  public void testWriteRawTo() {
    Command cmd = new Command(sampleStorage());
    Storage s = new Storage();
    cmd.writeRawTo(s);
    Iterator<Byte> bytes = s.getStorageList().iterator();
    assertEquals(0, (int)bytes.next());
    assertEquals(0, (int)bytes.next());
    assertEquals(0, (int)bytes.next());
    assertEquals(0, (int)bytes.next());
    assertEquals(10, (int)bytes.next());
View Full Code Here

  protected abstract C makeCollection();
 
  @Override
  protected C readValue(Command resp) throws TraCIException {
    Storage content = resp.content();
    List<String> ids = new StringList(content, true);
    C out = makeCollection();
    for (String id : ids) {
      try {
        out.add(repository.getByID(id));
View Full Code Here

  }

  @Override
  protected List<Link> readValue(Command resp) throws TraCIException {
    List<Link> out = new ArrayList<Link>();
    Storage content = resp.content();
    Utils.checkType(content, Constants.TYPE_COMPOUND);
    content.readInt(); // ignore link data length
    Utils.checkType(content, Constants.TYPE_INTEGER);
    int count = content.readInt();
    for (int i=0; i<count; i++) {
      try {
        out.add(new Link(content, laneRepo));
      } catch (IOException e) {
        throw new TraCIException(e.toString());
View Full Code Here

  }

  @Override
  protected ControlledLinks readValue(Command resp)
      throws TraCIException {
    final Storage content = resp.content();
    Utils.checkType(content, Constants.TYPE_COMPOUND);
    content.readInt(); // ignore data length
    try {
      return new ControlledLinks(content, laneRepo);
    } catch (IOException e) {
      throw new TraCIException(e.getMessage());
    }
View Full Code Here

  }
 
  @Override
  List<Command> getRequests() {
    Command cmd = new Command(commandID);
    Storage content = cmd.content();
    content.writeUnsignedByte(varID);
    content.writeStringASCII(objectID);
    return Collections.singletonList(cmd);
  }
View Full Code Here

TOP

Related Classes of de.uniluebeck.itm.tcpip.Storage

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.