List of usage examples for com.google.common.io LittleEndianDataInputStream skip
public long skip(long n) throws IOException
n
bytes of data from the input stream. From source file:pw.simplyintricate.bitcoin.models.datastructures.NetworkAddress.java
public static NetworkAddress fromInputStream(LittleEndianDataInputStream reader, boolean readTime) throws IOException { int time = -1; if (readTime) { time = reader.readInt();/* w ww .j a v a 2 s . c o m*/ } long services = reader.readLong(); reader.skip(12); // skip ipv6 support :( byte[] ipAddress = new byte[4]; reader.read(ipAddress, 0, 4); short port = EndianUtils.swapShort(((short) reader.readUnsignedShort())); NetworkAddress networkAddress; if (readTime) { networkAddress = new NetworkAddress(UnsignedInteger.valueOf(services), ipAddress, port, UnsignedInteger.fromIntBits(time)); } else { networkAddress = new NetworkAddress(UnsignedInteger.valueOf(services), ipAddress, port); } return networkAddress; }