code: public static CodedInputStream newInstance(final byte[] buf, final int off,
                                               final int len) {
      CodedInputStream result = new CodedInputStream(buf, off, len);
      try {
        // Some uses of CodedInputStream can be more efficient if they know
        // exactly how many bytes are available.  By pushing the end point of the
        // buffer as a limit, we allow them to get this information via
        // getBytesUntilLimit().  Pushing a limit that we know is at the end of
        // the stream can never hurt, since we can never past that point anyway.
        result.pushLimit(len);
      } catch (InvalidProtocolBufferException ex) {
        // The only reason pushLimit() might throw an exception here is if len
        // is negative. Normally pushLimit()'s parameter comes directly off the
        // wire, so it's important to catch exceptions in case of corrupt or
        // malicious data. However, in this case, we expect that len is not a
        // user-supplied value, so we can assume that it being negative indicates
        // a programming error. Therefore, throwing an unchecked exception is
        // appropriate.
        throw new IllegalArgumentException(ex);
      }
      return result;
    }
docs: Create a new CodedInputStream wrapping the given byte array slice.