public void clear() { super.clear(); encodedForm = null; decoded = true; }
@SuppressWarnings("unchecked") public T assertInitialized() throws UninitializedMessageException { java.util.ArrayList<String> missingFields = missingFields(); if (!missingFields.isEmpty()) { throw new UninitializedMessageException(missingFields); } return getThis(); }
public ArrayList<String> missingFields() { load(); return new ArrayList<String>(); }
public T mergeUnframed(InputStream input) throws IOException { CodedInputStream codedInput = new CodedInputStream(input); mergeUnframed(codedInput); return getThis(); }
public T mergeFramed(InputStream input) throws IOException { int length = readRawVarint32(input); byte[] data = new byte[length]; int pos = 0; while (pos < length) { int r = input.read(data, pos, length - pos); if (r < 0) { throw new InvalidProtocolBufferException("Input stream ended before a full message frame could be read."); } pos += r; } return mergeUnframed(data); }
public T addAllFilters(java.lang.Iterable<? extends java.lang.String> collection) { loadAndClear(); super.addAll(collection, getFiltersList()); return (T)this; }
public T mergeFramed(Buffer data) throws InvalidProtocolBufferException { try { CodedInputStream input = new CodedInputStream(data); mergeFramed(input); input.checkLastTagWas(0); return getThis(); } catch (InvalidProtocolBufferException e) { throw e; } catch (IOException e) { throw new RuntimeException("An IOException was thrown (should never happen in this method).", e); } }
public T mergeUnframed(byte[] data) throws InvalidProtocolBufferException { return mergeUnframed(new Buffer(data)); }
@SuppressWarnings("unchecked") public T mergeFrom(T other) { return getThis(); }
public boolean isInitialized() { return missingFields().isEmpty(); }
byte tmp = readRawByte(is); if (tmp >= 0) { return tmp; if ((tmp = readRawByte(is)) >= 0) { result |= tmp << 7; } else { result |= (tmp & 0x7f) << 7; if ((tmp = readRawByte(is)) >= 0) { result |= tmp << 14; } else { result |= (tmp & 0x7f) << 14; if ((tmp = readRawByte(is)) >= 0) { result |= tmp << 21; } else { result |= (tmp & 0x7f) << 21; result |= (tmp = readRawByte(is)) << 28; if (tmp < 0) { if (readRawByte(is) >= 0) return result;
protected void loadAndClear() { super.loadAndClear(); load(); encodedForm = null; }
public T mergeFramed(byte[] data) throws InvalidProtocolBufferException { return mergeFramed(new Buffer(data)); }
public T mergeUnframed(Buffer data) throws InvalidProtocolBufferException { try { CodedInputStream input = new CodedInputStream(data); mergeUnframed(input); input.checkLastTagWas(0); return getThis(); } catch (InvalidProtocolBufferException e) { throw e; } catch (IOException e) { throw new RuntimeException("An IOException was thrown (should never happen in this method).", e); } }
public T addAllHashes(java.lang.Iterable<? extends Hash> collection) { loadAndClear(); super.addAll(collection, getHashesList()); return (T)this; }
static protected <T extends BaseMessage> T readGroup(CodedInputStream input, int tag, T group) throws IOException { group.mergeUnframed(input); input.checkLastTagWas(WireFormat.makeTag(tag, WireFormat.WIRETYPE_END_GROUP)); return group; }
@SuppressWarnings("unchecked") protected T checktInitialized() throws InvalidProtocolBufferException { java.util.ArrayList<String> missingFields = missingFields(); if (!missingFields.isEmpty()) { throw new UninitializedMessageException(missingFields).asInvalidProtocolBufferException(); } return getThis(); }
public T addAllFiles(java.lang.Iterable<? extends File> collection) { loadAndClear(); super.addAll(collection, getFilesList()); return (T)this; }
public T mergeFramed(CodedInputStream input) throws IOException { int length = input.readRawVarint32(); int oldLimit = input.pushLimit(length); T rc = mergeUnframed(input); input.checkLastTagWas(0); input.popLimit(oldLimit); return rc; }
public T addAllSegments(java.lang.Iterable<? extends Segment> collection) { loadAndClear(); super.addAll(collection, getSegmentsList()); return (T)this; }