/** * Parses an entry off of the input as a {@link Map.Entry}. This helper requires an allocation * so using {@link #parseInto} is preferred if possible. */ public Map.Entry<K, V> parseEntry(ByteString bytes, ExtensionRegistryLite extensionRegistry) throws IOException { return parseEntry(bytes.newCodedInput(), metadata, extensionRegistry); }
public BuilderType mergeFrom(final ByteString data) throws InvalidProtocolBufferException { try { final CodedInputStream input = data.newCodedInput(); mergeFrom(input); input.checkLastTagWas(0); return (BuilderType) this; } catch (InvalidProtocolBufferException e) { throw e; } catch (IOException e) { throw new RuntimeException( "Reading from a ByteString threw an IOException (should " + "never happen).", e); } }
private static <T extends GeneratedMessageLite<T, ?>> T parsePartialFrom( T defaultInstance, ByteString data, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException { T message; try { CodedInputStream input = data.newCodedInput(); message = parsePartialFrom(defaultInstance, input, extensionRegistry); try { input.checkLastTagWas(0); } catch (InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(message); } return message; } catch (InvalidProtocolBufferException e) { throw e; } }
/** * Parse {@code data} as an {@code UnknownFieldSet} and merge it with the * set being built. This is just a small wrapper around * {@link #mergeFrom(CodedInputStream)}. */ public Builder mergeFrom(final ByteString data) throws InvalidProtocolBufferException { try { final CodedInputStream input = data.newCodedInput(); mergeFrom(input); input.checkLastTagWas(0); return this; } catch (final InvalidProtocolBufferException e) { throw e; } catch (final IOException e) { throw new RuntimeException( "Reading from a ByteString threw an IOException (should " + "never happen).", e); } }
public MessageType parsePartialFrom(ByteString data, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException { MessageType message; try { CodedInputStream input = data.newCodedInput(); message = parsePartialFrom(input, extensionRegistry); try { input.checkLastTagWas(0); } catch (InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(message); } return message; } catch (InvalidProtocolBufferException e) { throw e; } catch (IOException e) { throw new RuntimeException( "Reading from a ByteString threw an IOException (should " + "never happen).", e); } }
@Override public MessageType parsePartialFrom(ByteString data, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException { MessageType message; try { CodedInputStream input = data.newCodedInput(); message = parsePartialFrom(input, extensionRegistry); try { input.checkLastTagWas(0); } catch (InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(message); } return message; } catch (InvalidProtocolBufferException e) { throw e; } }
public BuilderType mergeFrom( final ByteString data, final ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException { try { final CodedInputStream input = data.newCodedInput(); mergeFrom(input, extensionRegistry); input.checkLastTagWas(0); return (BuilderType) this; } catch (InvalidProtocolBufferException e) { throw e; } catch (IOException e) { throw new RuntimeException( "Reading from a ByteString threw an IOException (should " + "never happen).", e); } }
@Override public BuilderType mergeFrom(final ByteString data) throws InvalidProtocolBufferException { try { final CodedInputStream input = data.newCodedInput(); mergeFrom(input); input.checkLastTagWas(0); return (BuilderType) this; } catch (InvalidProtocolBufferException e) { throw e; } catch (IOException e) { throw new RuntimeException(getReadingExceptionMessage("ByteString"), e); } }
/** * Parse {@code data} as an {@code UnknownFieldSet} and merge it with the * set being built. This is just a small wrapper around * {@link #mergeFrom(CodedInputStream)}. */ @Override public Builder mergeFrom(final ByteString data) throws InvalidProtocolBufferException { try { final CodedInputStream input = data.newCodedInput(); mergeFrom(input); input.checkLastTagWas(0); return this; } catch (final InvalidProtocolBufferException e) { throw e; } catch (final IOException e) { throw new RuntimeException( "Reading from a ByteString threw an IOException (should " + "never happen).", e); } }
@Override public BuilderType mergeFrom( final ByteString data, final ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException { try { final CodedInputStream input = data.newCodedInput(); mergeFrom(input, extensionRegistry); input.checkLastTagWas(0); return (BuilderType) this; } catch (InvalidProtocolBufferException e) { throw e; } catch (IOException e) { throw new RuntimeException(getReadingExceptionMessage("ByteString"), e); } }
stream = UnsafeByteOperations.unsafeWrap(buf.nioBuffer()).newCodedInput(); stream.enableAliasing(true); } else {
return new Iterator<BlockReportReplica>() { final BlockReportReplica block = new BlockReportReplica(); final CodedInputStream cis = buffer.newCodedInput(); private int currentBlockIndex = 0;
/** * Parses an entry off of the input as a {@link Map.Entry}. This helper requires an allocation * so using {@link #parseInto} is preferred if possible. */ public Map.Entry<K, V> parseEntry(ByteString bytes, ExtensionRegistryLite extensionRegistry) throws IOException { return parseEntry(bytes.newCodedInput(), metadata, extensionRegistry); }
/** * Parses an entry off of the input as a {@link Map.Entry}. This helper requires an allocation * so using {@link #parseInto} is preferred if possible. */ public Map.Entry<K, V> parseEntry(ByteString bytes, ExtensionRegistryLite extensionRegistry) throws IOException { return parseEntry(bytes.newCodedInput(), metadata, extensionRegistry); }
public Service.Request transform(ByteString serializedMessage) throws InvalidProtocolBufferException { // This should already be an aliased CodedInputStream from the WireMessage parsing. Message msg = parser.parseFrom(serializedMessage.newCodedInput()); if (LOG.isTraceEnabled()) { LOG.trace("Deserialized request '{}'", TextFormat.shortDebugString(msg)); } return impl.deserialize(msg); } }
public Service.Request transform(ByteString serializedMessage) throws InvalidProtocolBufferException { // This should already be an aliased CodedInputStream from the WireMessage parsing. Message msg = parser.parseFrom(serializedMessage.newCodedInput()); if (LOG.isTraceEnabled()) { LOG.trace("Deserialized request '{}'", TextFormat.shortDebugString(msg)); } return impl.deserialize(msg); } }
public BuilderType mergeFrom(final ByteString data) throws InvalidProtocolBufferException { try { final CodedInputStream input = data.newCodedInput(); mergeFrom(input); input.checkLastTagWas(0); return (BuilderType) this; } catch (InvalidProtocolBufferException e) { throw e; } catch (IOException e) { throw new RuntimeException( "Reading from a ByteString threw an IOException (should " + "never happen).", e); } }
@Override public BuilderType mergeFrom( final ByteString data, final ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException { try { final CodedInputStream input = data.newCodedInput(); mergeFrom(input, extensionRegistry); input.checkLastTagWas(0); return (BuilderType) this; } catch (InvalidProtocolBufferException e) { throw e; } catch (IOException e) { throw new RuntimeException(getReadingExceptionMessage("ByteString"), e); } }
@Override public BuilderType mergeFrom(final ByteString data) throws InvalidProtocolBufferException { try { final CodedInputStream input = data.newCodedInput(); mergeFrom(input); input.checkLastTagWas(0); return (BuilderType) this; } catch (InvalidProtocolBufferException e) { throw e; } catch (IOException e) { throw new RuntimeException(getReadingExceptionMessage("ByteString"), e); } }
@Override public BuilderType mergeFrom(final ByteString data) throws InvalidProtocolBufferException { try { final CodedInputStream input = data.newCodedInput(); mergeFrom(input); input.checkLastTagWas(0); return (BuilderType) this; } catch (InvalidProtocolBufferException e) { throw e; } catch (IOException e) { throw new RuntimeException(getReadingExceptionMessage("ByteString"), e); } }