Package org.spoutcraft.api.io

Examples of org.spoutcraft.api.io.SpoutOutputStream


  public void writeData(SpoutOutputStream output) throws IOException {
    output.writeInt(widget.getType().getId());
    output.writeUUID(widget.getScreen().getId());
    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


      return;
    }
    //System.out.println("Writing Packet Data for " + packet.getPacketType());
    var1.writeShort(packet.getPacketType().getId());
    var1.writeShort(packet.getVersion());
    final SpoutOutputStream stream = new SpoutOutputStream();
    packet.writeData(stream);
    ByteBuffer buffer = stream.getRawBuffer();
    byte[] data = new byte[buffer.capacity() - buffer.remaining()];
    System.arraycopy(buffer.array(), 0, data, 0, data.length);

    var1.writeInt(data.length);
    var1.write(data, 0, data.length);
View Full Code Here

TOP

Related Classes of org.spoutcraft.api.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.