public SocketAddress reset() { port = 0; hostLength(0); return this; }
public SocketAddress reset() { port = 0; hostLength(0); return this; }
private static int writeSocketAddress( SocketAddress apiAddress, MutableDirectBuffer directBuffer, int offset) { directBuffer.putInt(offset, apiAddress.hostLength(), ByteOrder.LITTLE_ENDIAN); offset += SIZE_OF_INT; directBuffer.putBytes(offset, apiAddress.getHostBuffer(), 0, apiAddress.hostLength()); offset += apiAddress.hostLength(); directBuffer.putInt(offset, apiAddress.port(), ByteOrder.LITTLE_ENDIAN); offset += SIZE_OF_INT; return offset; }
private static int writeSocketAddress( SocketAddress apiAddress, MutableDirectBuffer directBuffer, int offset) { directBuffer.putInt(offset, apiAddress.hostLength(), ByteOrder.LITTLE_ENDIAN); offset += SIZE_OF_INT; directBuffer.putBytes(offset, apiAddress.getHostBuffer(), 0, apiAddress.hostLength()); offset += apiAddress.hostLength(); directBuffer.putInt(offset, apiAddress.port(), ByteOrder.LITTLE_ENDIAN); offset += SIZE_OF_INT; return offset; }
public SocketAddress(SocketAddress other) { this(); host(other.hostBuffer, 0, other.hostLength()); port(other.port); }
public SocketAddress host(final DirectBuffer src, int offset, final int length) { checkHostLength(length); hostLength(length); hostBuffer.putBytes(0, src, offset, length); return this; }
public SocketAddress host(final DirectBuffer src, int offset, final int length) { checkHostLength(length); hostLength(length); hostBuffer.putBytes(0, src, offset, length); return this; }
public SocketAddress host(final byte[] src, final int offset, final int length) { checkHostLength(length); hostLength(length); hostBuffer.putBytes(0, src, offset, length); return this; }
public String host() { final int hostLength = hostLength(); final byte[] tmp = new byte[hostLength]; hostBuffer.getBytes(0, tmp, 0, hostLength); return fromBytes(tmp); }
public SocketAddress(SocketAddress other) { this(); host(other.hostBuffer, 0, other.hostLength()); port(other.port); }
public String host() { final int hostLength = hostLength(); final byte[] tmp = new byte[hostLength]; hostBuffer.getBytes(0, tmp, 0, hostLength); return fromBytes(tmp); }
public SocketAddress host(final byte[] src, final int offset, final int length) { checkHostLength(length); hostLength(length); hostBuffer.putBytes(0, src, offset, length); return this; }
public void wrap(final SocketAddress endpoint) { reset(); host(endpoint.getHostBuffer(), 0, endpoint.hostLength()); port(endpoint.port()); }
public void wrap(final SocketAddress endpoint) { reset(); host(endpoint.getHostBuffer(), 0, endpoint.hostLength()); port(endpoint.port()); }