public Buffer(ByteBuffer.ByteOrder order) { b = _emptyBuffer; _size = 0; _capacity = 0; _order = order; }
public void beginWrite(EndPoint endpoint, Buffer buf) { if (!(endpoint is IPEndPoint)) { throw new Ice.FeatureNotSupportedException("SOCKS4 does not support domain names"); } else if (endpoint.AddressFamily != AddressFamily.InterNetwork) { throw new Ice.FeatureNotSupportedException("SOCKS4 only supports IPv4 addresses"); } // // SOCKS connect request // IPEndPoint addr = (IPEndPoint)endpoint; buf.resize(9, false); ByteBuffer.ByteOrder order = buf.b.order(); buf.b.order(ByteBuffer.ByteOrder.BIG_ENDIAN); // Network byte order. buf.b.position(0); buf.b.put(0x04); // SOCKS version 4. buf.b.put(0x01); // Command, establish a TCP/IP stream connection buf.b.putShort((short)addr.Port); // Port buf.b.put(addr.Address.GetAddressBytes()); // IPv4 address buf.b.put(0x00); // User ID. buf.b.position(0); buf.b.limit(buf.size()); buf.b.order(order); }
public Buffer(ByteBuffer data, ByteBuffer.ByteOrder order) { b = data; b.order(order); _size = data.remaining(); _capacity = 0; _order = order; }
public Buffer(byte[] data, ByteBuffer.ByteOrder order) { b = ByteBuffer.wrap(data); b.order(order); _size = data.Length; _capacity = 0; _order = order; }
public Buffer(ByteBuffer data, ByteBuffer.ByteOrder order) { B = data; B.Order(order); _size = data.Remaining(); _capacity = 0; _order = order; }
public Buffer(Buffer buf, bool adopt) { b = buf.b; _size = buf._size; _capacity = buf._capacity; _shrinkCounter = buf._shrinkCounter; _order = buf._order; if(adopt) { buf.clear(); } }