Package logisticspipes.network

Examples of logisticspipes.network.LPDataOutputStream


              DataOutputStream data = new DataOutputStream(out);
              data.write(clientBuffer);
              LinkedList<ModernPacket> packets = clientList;
              clearLock.lock();
              for(ModernPacket packet:packets) {
                LPDataOutputStream t = new LPDataOutputStream();
                t.writeShort(packet.getId());
                t.writeInt(packet.getDebugId());
                packet.writeData(t);
                data.writeInt(t.size());
                data.write(t.toByteArray());
              }
              packets.clear();
              clearLock.unlock();
              clientBuffer = out.toByteArray();
            }
View Full Code Here


                if(towrite != null) {
                  data.write(towrite);
                }
                LinkedList<ModernPacket> packets = player.getValue();
                for(ModernPacket packet:packets) {
                  LPDataOutputStream t = new LPDataOutputStream();
                  t.writeShort(packet.getId());
                  t.writeInt(packet.getDebugId());
                  packet.writeData(t);
                  data.writeInt(t.size());
                  data.write(t.toByteArray());
                }
                serverBuffer.put(player.getKey(), out.toByteArray());
              }
              serverList.clear();
            }
View Full Code Here

  }

  @Override
  public void writeData(LPDataOutputStream data) throws IOException {
    super.writeData(data);
    LPDataOutputStream out = new LPDataOutputStream();
    renderState.writeData(out);
    byte[] bytes = out.toByteArray();
    data.writeInt(bytes.length);
    data.write(bytes);

    out = new LPDataOutputStream();
    coreState.writeData(out);
    bytes = out.toByteArray();
    data.writeInt(bytes.length);
    data.write(bytes);
   
    out = new LPDataOutputStream();
    bcCoreState.writeData(out);
    bytes = out.toByteArray();
    data.writeInt(bytes.length);
    data.write(bytes);
   
    out = new LPDataOutputStream();
    pipe.writeData(out);
    bytes = out.toByteArray();
    data.writeInt(bytes.length);
    data.write(bytes);
  }
View Full Code Here

TOP

Related Classes of logisticspipes.network.LPDataOutputStream

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.