Package org.spoutcraft.api.io

Examples of org.spoutcraft.api.io.SpoutInputStream


      final MappedByteBuffer buffer = read.map(FileChannel.MapMode.READ_ONLY, 0, read.size());
      stream.close();
      customId = buffer.getShort();
      data = buffer.get();
      design = new GenericBlockDesign();
      design.read(new SpoutInputStream(buffer));

    } catch (IOException e) {
      e.printStackTrace();
    } finally {
      if (design != null && design.isReset()) {
View Full Code Here


  public void run(int playerId) {
    try {
      if (allWidgets.containsKey(widgetId)) {
        widget = allWidgets.get(widgetId);
        if (widget.getVersion() == version) {
          widget.readData(new SpoutInputStream(widgetData));
        }
      } else {
        widget = widgetType.getWidgetClass().newInstance();

        // Hackish way to set the ID without a setter
        ((GenericWidget) widget).setId(widgetId);
        if (widget.getVersion() == version) {
          widget.readData(new SpoutInputStream(widgetData));
        } else {
          if (nags[widgetType.getId()]-- > 0) {
            System.out.println("Received invalid widget: " + widgetType.getWidgetClass().getSimpleName() + " v: " + version + " current v: " + widget.getVersion());
          }
          widget = null;
View Full Code Here

        outdated = outdated || version > packet.getVersion();
      } else {
        byte[] data = new byte[length];
        var1.readFully(data);

        SpoutInputStream stream = new SpoutInputStream(ByteBuffer.wrap(data));
        packet.readData(stream);
        success = true;
      }
    } catch (Exception e) {
      System.out.println("------------------------");
View Full Code Here

TOP

Related Classes of org.spoutcraft.api.io.SpoutInputStream

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.