com.google.protobuf.AbstractMessageLite.Builder.LimitedInputStream Java Examples

The following examples show how to use com.google.protobuf.AbstractMessageLite.Builder.LimitedInputStream. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AbstractParser.java    From play-store-api with GNU General Public License v3.0 6 votes vote down vote up
@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);
}
 
Example #2
Source File: AbstractParser.java    From travelguide with Apache License 2.0 6 votes vote down vote up
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);
}
 
Example #3
Source File: AbstractParser.java    From 365browser with Apache License 2.0 6 votes vote down vote up
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);
}
 
Example #4
Source File: AbstractParser.java    From android-chromium with BSD 2-Clause "Simplified" License 6 votes vote down vote up
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);
}
 
Example #5
Source File: AbstractParser.java    From android-chromium with BSD 2-Clause "Simplified" License 6 votes vote down vote up
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);
}
 
Example #6
Source File: UnknownFieldSet.java    From play-store-api with GNU General Public License v3.0 5 votes vote down vote up
@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;
}
 
Example #7
Source File: UnknownFieldSet.java    From travelguide with Apache License 2.0 5 votes vote down vote up
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;
}
 
Example #8
Source File: UnknownFieldSet.java    From 365browser with Apache License 2.0 5 votes vote down vote up
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;
}
 
Example #9
Source File: UnknownFieldSet.java    From android-chromium with BSD 2-Clause "Simplified" License 5 votes vote down vote up
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;
}
 
Example #10
Source File: UnknownFieldSet.java    From android-chromium with BSD 2-Clause "Simplified" License 5 votes vote down vote up
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;
}