Guest User

KLASY PR0XY

a guest
Sep 1st, 2017
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.67 KB | None | 0 0
  1. KLASA COutputStreamThread:
  2. if (toSend != null)
  3.         {
  4.           ByteArrayOutputStream baos = new ByteArrayOutputStream();
  5.           PacketOutputStream pos = new PacketOutputStream(baos);
  6.           pos.handler = this.handler;
  7.           toSend.write(pos);
  8.           this.stream.writeVarInt(baos.size());
  9.           baos.writeTo(this.stream);
  10.         }
  11.  
  12. KLASA PacketOutputStream:
  13. LINIJKA 34:
  14. public void write(int b)
  15.     throws IOException
  16.   {
  17.     this.stream.write(b);
  18.   }
  19.  
  20. LINIJKA 115:
  21. public void writeVarInt(int n)
  22.     throws IOException
  23.   {
  24.     while ((n & 0xFFFFFF80) != 0)
  25.     {
  26.       write(n & 0x7F | 0x80);
  27.       n >>>= 7;
  28.     }
  29.     write(n);
  30.   }
Advertisement
Add Comment
Please, Sign In to add comment