本文整理汇总了Java中com.google.protobuf.AbstractMessageLite.Builder.LimitedInputStream类的典型用法代码示例。如果您正苦于以下问题:Java LimitedInputStream类的具体用法?Java LimitedInputStream怎么用?Java LimitedInputStream使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
LimitedInputStream类属于com.google.protobuf.AbstractMessageLite.Builder包,在下文中一共展示了LimitedInputStream类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: parsePartialDelimitedFrom
import com.google.protobuf.AbstractMessageLite.Builder.LimitedInputStream; //导入依赖的package包/类
public MessageType parsePartialDelimitedFrom(
InputStream input,
ExtensionRegistryLite extensionRegistry)
throws InvalidProtocolBufferException {
int size;
try {
int firstByte = input.read();
if (firstByte == -1) {
return null;
}
size = CodedInputStream.readRawVarint32(firstByte, input);
} catch (IOException e) {
throw new InvalidProtocolBufferException(e.getMessage());
}
InputStream limitedInput = new LimitedInputStream(input, size);
return parsePartialFrom(limitedInput, extensionRegistry);
}
示例2: parsePartialDelimitedFrom
import com.google.protobuf.AbstractMessageLite.Builder.LimitedInputStream; //导入依赖的package包/类
@Override
public MessageType parsePartialDelimitedFrom(
InputStream input, ExtensionRegistryLite extensionRegistry)
throws InvalidProtocolBufferException {
int size;
try {
int firstByte = input.read();
if (firstByte == -1) {
return null;
}
size = CodedInputStream.readRawVarint32(firstByte, input);
} catch (IOException e) {
throw new InvalidProtocolBufferException(e.getMessage());
}
InputStream limitedInput = new LimitedInputStream(input, size);
return parsePartialFrom(limitedInput, extensionRegistry);
}
示例3: parsePartialDelimitedFrom
import com.google.protobuf.AbstractMessageLite.Builder.LimitedInputStream; //导入依赖的package包/类
public MessageType parsePartialDelimitedFrom (
InputStream input,
ExtensionRegistryLite extensionRegistry)
throws InvalidProtocolBufferException {
int size;
try {
int firstByte = input.read ();
if (firstByte == -1) {
return null;
}
size = CodedInputStream.readRawVarint32 (firstByte, input);
} catch (IOException e) {
throw new InvalidProtocolBufferException (e.getMessage ());
}
InputStream limitedInput = new LimitedInputStream (input, size);
return parsePartialFrom (limitedInput, extensionRegistry);
}
示例4: parsePartialDelimitedFrom
import com.google.protobuf.AbstractMessageLite.Builder.LimitedInputStream; //导入依赖的package包/类
@Override
public MessageType parsePartialDelimitedFrom(
InputStream input, ExtensionRegistryLite extensionRegistry)
throws InvalidProtocolBufferException {
int size;
try {
int firstByte = input.read();
if (firstByte == -1) {
return null;
}
size = CodedInputStream.readRawVarint32(firstByte, input);
} catch (IOException e) {
throw new InvalidProtocolBufferException(e);
}
InputStream limitedInput = new LimitedInputStream(input, size);
return parsePartialFrom(limitedInput, extensionRegistry);
}
示例5: mergeDelimitedFrom
import com.google.protobuf.AbstractMessageLite.Builder.LimitedInputStream; //导入依赖的package包/类
public boolean mergeDelimitedFrom(InputStream input)
throws IOException {
final int firstByte = input.read();
if (firstByte == -1) {
return false;
}
final int size = CodedInputStream.readRawVarint32(firstByte, input);
final InputStream limitedInput = new LimitedInputStream(input, size);
mergeFrom(limitedInput);
return true;
}
示例6: mergeDelimitedFrom
import com.google.protobuf.AbstractMessageLite.Builder.LimitedInputStream; //导入依赖的package包/类
@Override
public boolean mergeDelimitedFrom(InputStream input) throws IOException {
final int firstByte = input.read();
if (firstByte == -1) {
return false;
}
final int size = CodedInputStream.readRawVarint32(firstByte, input);
final InputStream limitedInput = new LimitedInputStream(input, size);
mergeFrom(limitedInput);
return true;
}
示例7: mergeDelimitedFrom
import com.google.protobuf.AbstractMessageLite.Builder.LimitedInputStream; //导入依赖的package包/类
public boolean mergeDelimitedFrom (InputStream input)
throws IOException {
final int firstByte = input.read ();
if (firstByte == -1) {
return false;
}
final int size = CodedInputStream.readRawVarint32 (firstByte, input);
final InputStream limitedInput = new LimitedInputStream (input, size);
mergeFrom (limitedInput);
return true;
}