Package org.getspout.spoutapi.io

Examples of org.getspout.spoutapi.io.SpoutOutputStream


  public PacketAddonData() {
  }

  public PacketAddonData(AddonPacket packet) {
    this.packet = packet;
    SpoutOutputStream stream = new SpoutOutputStream();
    try {
      packet.write(stream);
    } catch (Exception e) {
    }
    ByteBuffer buffer = stream.getRawBuffer();
    data = new byte[buffer.capacity() - buffer.remaining()];
    System.arraycopy(buffer.array(), 0, data, 0, data.length);
    needsCompression = data.length > 512;
  }
View Full Code Here


  public void writeData(SpoutOutputStream output) throws IOException {
    output.writeInt(widget.getType().getId());
    output.writeUUID(screen);
    output.writeUUID(widget.getId());

    SpoutOutputStream data = new SpoutOutputStream();
    widget.writeData(data);
    ByteBuffer buffer = data.getRawBuffer();
    byte[] widgetData = new byte[buffer.capacity() - buffer.remaining()];
    System.arraycopy(buffer.array(), 0, widgetData, 0, widgetData.length);

    output.writeInt(widgetData.length);
    output.writeShort((short) widget.getVersion());
View Full Code Here

TOP

Related Classes of org.getspout.spoutapi.io.SpoutOutputStream

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.