本文整理匯總了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);
}