本文整理汇总了Java中com.esotericsoftware.kryo.io.Input.readBytes方法的典型用法代码示例。如果您正苦于以下问题:Java Input.readBytes方法的具体用法?Java Input.readBytes怎么用?Java Input.readBytes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.esotericsoftware.kryo.io.Input
的用法示例。
在下文中一共展示了Input.readBytes方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: read
import com.esotericsoftware.kryo.io.Input; //导入方法依赖的package包/类
@Override
public IpPrefix read(Kryo kryo, Input input,
Class<IpPrefix> type) {
int octLen = input.readInt();
checkArgument(octLen <= IpAddress.INET6_BYTE_LENGTH);
byte[] octs = new byte[octLen];
input.readBytes(octs);
int prefLen = input.readInt();
// Use the address size to decide whether it is IPv4 or IPv6 address
if (octLen == IpAddress.INET_BYTE_LENGTH) {
return IpPrefix.valueOf(IpAddress.Version.INET, octs, prefLen);
}
if (octLen == IpAddress.INET6_BYTE_LENGTH) {
return IpPrefix.valueOf(IpAddress.Version.INET6, octs, prefLen);
}
return null; // Shouldn't be reached
}
示例2: read
import com.esotericsoftware.kryo.io.Input; //导入方法依赖的package包/类
@Override
public Ip6Prefix read(Kryo kryo, Input input,
Class<Ip6Prefix> type) {
int octLen = input.readInt();
checkArgument(octLen <= Ip6Address.BYTE_LENGTH);
byte[] octs = new byte[octLen];
input.readBytes(octs);
int prefLen = input.readInt();
return Ip6Prefix.valueOf(octs, prefLen);
}
示例3: read
import com.esotericsoftware.kryo.io.Input; //导入方法依赖的package包/类
@Override
public Ip4Address read(Kryo kryo, Input input, Class<Ip4Address> type) {
final int octLen = input.readInt();
checkArgument(octLen == Ip4Address.BYTE_LENGTH);
byte[] octs = new byte[octLen];
input.readBytes(octs);
return Ip4Address.valueOf(octs);
}
示例4: read
import com.esotericsoftware.kryo.io.Input; //导入方法依赖的package包/类
@Override
public IpAddress read(Kryo kryo, Input input, Class<IpAddress> type) {
final int octLen = input.readInt();
checkArgument(octLen <= IpAddress.INET6_BYTE_LENGTH);
byte[] octs = new byte[octLen];
input.readBytes(octs);
// Use the address size to decide whether it is IPv4 or IPv6 address
if (octLen == IpAddress.INET_BYTE_LENGTH) {
return IpAddress.valueOf(IpAddress.Version.INET, octs);
}
if (octLen == IpAddress.INET6_BYTE_LENGTH) {
return IpAddress.valueOf(IpAddress.Version.INET6, octs);
}
return null; // Shouldn't be reached
}
示例5: read
import com.esotericsoftware.kryo.io.Input; //导入方法依赖的package包/类
@Override
public Ip4Prefix read(Kryo kryo, Input input,
Class<Ip4Prefix> type) {
int octLen = input.readInt();
checkArgument(octLen <= Ip4Address.BYTE_LENGTH);
byte[] octs = new byte[octLen];
input.readBytes(octs);
int prefLen = input.readInt();
return Ip4Prefix.valueOf(octs, prefLen);
}
示例6: read
import com.esotericsoftware.kryo.io.Input; //导入方法依赖的package包/类
@Override
public Ip6Address read(Kryo kryo, Input input, Class<Ip6Address> type) {
final int octLen = input.readInt();
checkArgument(octLen == Ip6Address.BYTE_LENGTH);
byte[] octs = new byte[octLen];
input.readBytes(octs);
return Ip6Address.valueOf(octs);
}